UNPKG

@dazejs/framework

Version:

Daze.js - A powerful web framework for Node.js

8 lines (6 loc) 213 B
import { createHash, BinaryLike } from 'crypto'; export const encrypt = (algorithm: string, content: BinaryLike) => { const hash = createHash(algorithm); hash.update(content); return hash.digest('hex'); };