source: frontend/node_modules/crypto-random-string/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 253 bytes
Line 
1'use strict';
2const crypto = require('crypto');
3
4module.exports = length => {
5 if (!Number.isFinite(length)) {
6 throw new TypeError('Expected a finite number');
7 }
8
9 return crypto.randomBytes(Math.ceil(length / 2)).toString('hex').slice(0, length);
10};
Note: See TracBrowser for help on using the repository browser.