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