Oslo

sha512()

Generates a SHA-512 hash.

Definition

function sha512(data: ArrayBuffer | TypedArray): Promise<ArrayBuffer>;

Parameters

  • data

Example

import { sha512 } from "oslo/crypto";
import { encodeHex } from "oslo/encoding";

const data = new TextEncoder().encode("hello, world");
const hash = await sha512(data);
const hexHash = encodeHex(hash);