UNPKG

multiformats

Version:

Interface for multihash, multicodec, multibase and CID

12 lines (9 loc) 254 B
// @ts-check import crypto from 'crypto' import { coerce } from '../bytes.js' import { from } from './hasher.js' export const sha1 = from({ name: 'sha-1', code: 0x11, encode: (input) => coerce(crypto.createHash('sha1').update(input).digest()) })