'use strict'; const crypto = require('crypto'); module.exports = len => { if (!Number.isFinite(len)) { throw new TypeError('Expected a finite number'); } return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len); };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
index.js | File | 241 B | 0644 |
|
license | File | 1.09 KB | 0644 |
|
package.json | File | 1.75 KB | 0644 |
|
readme.md | File | 1.37 KB | 0644 |
|