sha512

Computes the SHA-2-512 hash of a value.

Syntax

sha512(value, outputFormat?)

Parameters

Return value

A hex string or a Uint8Array representing the hash digest.

Example

sha512("hello")
"9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043"
sha512("hello", "bytes")
Uint8Array [155, 113, 210, 36, 189, 98, 243, 120, 93, 150, 212, 106, 211, 234, 61, 115, 49, 155, 251, 194, 137, 12, 170, 218, 226, 223, 247, 37, 25, 103, 60, 167, 35, 35, 195, 217, 155, 165, 193, 29, 124, 122, 204, 110, 20, 184, 197, 218, 12, 70, 99, 71, 92, 46, 92, 58, 222, 244, 111, 115, 188, 222, 192, 67]
sha512(new Uint8Array([1,2,3]))
"27864cc5219a951a7a6e52b8c8dddf6981d098da1658d96258c870b2c88dfbcb51841aea172a28bafa6a79731165584677066045c959ed0f9929688d04defc29"

See also