2024-07-08 02:35:47 +08:00

7 lines
252 B
TypeScript

import { createHash } from 'node:crypto'
import { customAlphabet } from 'nanoid'
export const hash = (content: string) => createHash('md5').update(content).digest('hex')
export const nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8)