Skip to main content

sha256

Function sha256 

Source
pub fn sha256(inputs: &[&[u8]]) -> Result<Sha256Hash, ProgramError>
Expand description

Compute SHA-256 over one or more byte slices.

The Solana sol_sha256 syscall accepts a vector of (ptr, len) pairs, so multi-part hashing is done in a single syscall without concatenation.

§Example

let hash = sha256(&[b"hello", b" world"])?;