Sha256
Computes a SHA-256 digest.
Module: Std::Hash::Sha256
Signature
rux
func Hash(message: char8[]) -> String;Parameters
| Name | Type | Description |
|---|---|---|
message | char8[] | The data to hash. |
Returns
String — the 32-byte (256-bit) digest as a 64-character lowercase hex string.
Description
SHA-256 is a secure, widely deployed cryptographic hash. Hash is a static method on the Sha256 type, so call it as Sha256::Hash(...).
Example
rux
import Std::Hash::Sha256;
import Std::Io::PrintLine;
func Main() -> int {
PrintLine(Sha256::Hash("hello"));
// 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
return 0;
}