SHA256

Compute the SHA-256 digest of n bytes at d in one shot.

Synopsis

Declared in <openssl/sha.h>

unsigned char*
SHA256(
    unsigned char const* d,
    size_t n,
    unsigned char* md);

Return Value

Pointer to the digest bytes, or NULL on error.

Parameters

NameDescription
dInput message bytes.
nNumber of bytes at d.
mdOutput buffer of at least SHA256_DIGEST_LENGTH bytes, or NULL for a static buffer (not thread-safe).