UNPKG

crypt-uniid

Version:

A secure, efficient, and machine-aware unique ID generator using timestamp, counter, and SHA-256 hashing.

6 lines 210 B
const crypto = require("crypto"); const algorithm = "sha256"; function createHash(value, encType = "hex") { return crypto.createHash(algorithm).update(value).digest(encType) } module.exports = createHash