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