pub fn sha2_256(data: &[u8]) -> [u8; 32]Expand description
Computes the SHA2-256 hash of the input.
This is a general-purpose SHA2-256 helper. Note that Aptos Secp256k1 ECDSA signing hashes the message with SHA3-256, not SHA2-256, so this function is not part of the signing path.
ยงExample
use aptos_sdk::crypto::sha2_256;
let hash = sha2_256(b"hello world");
assert_eq!(hash.len(), 32);