method sha2.sha256
The SHA-256 digest of input (32 bytes).
Example:
use std.crypto { sha2 }
use std.ser { bytesOf, hex }
fn main() io {
print(hex(&sha2.sha256(bytesOf(&"abc"))))
}Вывод
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
pub(api) static fn sha256(input: bytes) -> bytesС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
input | bytes |
Возвращает
bytes
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/crypto/crypto.oxl:99