Files
foundry-nft/node_modules/multiformats/src/hashes/sha1-browser.ts
T
hoelee 11e41de86a
CI / Foundry project (push) Waiting to run
Ready NFT
2024-08-18 17:10:03 +08:00

13 lines
270 B
TypeScript

/* global crypto */
import { from } from './hasher.js'
const sha = (name: AlgorithmIdentifier) =>
async (data: Uint8Array) => new Uint8Array(await crypto.subtle.digest(name, data))
export const sha1 = from({
name: 'sha-1',
code: 0x11,
encode: sha('SHA-1')
})