Module sha/sha_256
source · [−]Expand description
Code related to SHA_256
Functions
sourcedigest
digest
source(data: BufferSource): Promise<Sha256ArrayBuffer>
(data: BufferSource): Promise<Sha256ArrayBuffer>
Get the digest of the buffer
example
const buffer = new TextEncoder().encode("a file");
const digest = SHA_256.digest(buffer);
Parameters
data: BufferSource
Returns Promise<Sha256ArrayBuffer>
sourcehexify
hexify
source(digest: Sha256ArrayBuffer): string
(digest: Sha256ArrayBuffer): string
Get the hex string of the digest
example
const hash = SHA_256.hexify(digest);
Parameters
digest: Sha256ArrayBuffer