OxL Reference

method sha2.sha256

The SHA-256 digest of input (32 bytes).

Example:

oxl✓ checked in CI
use std.crypto { sha2 }
use std.ser { bytesOf, hex }

fn main() io {
  print(hex(&sha2.sha256(bytesOf(&"abc"))))
}
Output
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
pub(api) static fn sha256(input: bytes) -> bytes

Since. 1.0.0-beta

Parameters

NameType
inputbytes

Returns

bytes

Effects

none declared (pure unless the body says otherwise)

Defined in: std/crypto/crypto.oxl:99

See also