mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
refactor with async/await
Trying to be more robust about error handling and failure.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// all url safe
|
||||
// can't use uppercase because hostnames are lowercased
|
||||
var chars = 'abcdefghijklmnopqrstuvwxyz';
|
||||
const chars = 'abcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
module.exports = function rand_id() {
|
||||
var randomstring = '';
|
||||
export default function rand_id() {
|
||||
let randomstring = '';
|
||||
for (var i=0; i<10; ++i) {
|
||||
var rnum = Math.floor(Math.random() * chars.length);
|
||||
const rnum = Math.floor(Math.random() * chars.length);
|
||||
randomstring += chars[rnum];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user