projects
/
dotfiles
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
.gitignore added
[dotfiles/.git]
/
.config
/
coc
/
extensions
/
node_modules
/
coc-prettier
/
node_modules
/
crypto-random-string
/
index.js
1
'use strict';
2
const crypto = require('crypto');
3
4
module.exports = len => {
5
if (!Number.isFinite(len)) {
6
throw new TypeError('Expected a finite number');
7
}
8
9
return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len);
10
};