deno.land / x / jose@v5.2.4 / runtime / digest.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
import crypto from './webcrypto.ts'import type { DigestFunction } from './interfaces.d.ts'
const digest: DigestFunction = async ( algorithm: 'sha256' | 'sha384' | 'sha512', data: Uint8Array,): Promise<Uint8Array> => { const subtleDigest = `SHA-${algorithm.slice(-3)}` return new Uint8Array(await crypto.subtle.digest(subtleDigest, data))}export default digest
jose

Version Info

Tagged at
a month ago