// package
base64id
type: "module"
// preferences
// replacements (1)
snippet::base64-id
Simple or drop-in replacementThis package is no longer necessary. You can use `crypto.randomBytes` with `Buffer.prototype.toString` to generate a random base64 id
// example
import crypto from 'node:crypto';
const id = crypto
.randomBytes(15)
.toString('base64')
.replaceAll('+', '-')
.replaceAll('/', '_');