@nfen/webcrypto-ts
Version:
Enforced Webcrypto wrapper
15 lines (13 loc) • 454 B
text/typescript
import * as SHA from "../index.js";
describe("SHA_512", () => {
it("should hash", async () => {
const data = encode("a message");
const hash = await SHA.SHA_512.digest(data);
expect(hash.byteLength).toEqual(64);
});
it("should hexify", async () => {
const data = encode("a message");
const hash = await SHA.SHA_512.digest(data);
expect(SHA.SHA_512.hexify(hash)).toMatchSnapshot();
});
});