fixed randomGen

pull/12/head
tycrek 4 years ago
parent bed8c5e546
commit 9dfd14a35d
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -1,2 +1,2 @@
//const { cryptoRandomString } = require('crypto-random-string');
//module.exports = (length) => cryptoRandomString({ length, type: 'alphanumeric' });
const cryptoRandomString = require('crypto-random-string');
module.exports = (length) => cryptoRandomString({ length, type: 'alphanumeric' });

@ -1,7 +1,7 @@
const fs = require('fs-extra');
const Path = require('path');
const zwsGen = require('./idgen/zws');
//const randomGen = require('./idgen/random');
const randomGen = require('./idgen/random');
const idModes = {
zws: 'zws', // Zero-width spaces (see: https://zws.im/)
@ -16,6 +16,6 @@ module.exports = {
verify: (req, tokens) => req.headers.authorization && tokens.includes(req.headers.authorization),
generateId: (mode, lenth, originalName) =>
(mode == idModes.zws) ? zwsGen(lenth)
: (mode == idModes.r) ? zwsGen(lenth)//randomGen(lenth)
: (mode == idModes.r) ? randomGen(lenth)
: originalName
}
Loading…
Cancel
Save