Skip to content

Commit

Permalink
Remove random.js dependancy
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmoss committed Jul 2, 2018
1 parent 7b2cb3c commit 6f896c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var Big = require('big.js'),
generate = require('random.js').randomInt,
characterSet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

var Base62 = {
Expand Down Expand Up @@ -46,15 +45,8 @@ var Base62 = {
id: function(short) {
return short ? Base62.decodeHex(short) : null;
},
token: function() {
return random()+random()+random()+random()+random();
}
};

function random() {
return Base62.encode(generate());
}

function intToHex(decStr) {
var hex = convertBase(decStr, 10, 16);
return hex ? hex : null;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"ObjectID"
],
"dependencies": {
"big.js": "3.x",
"random.js": "0.1.0"
"big.js": "3.x"
},
"devDependencies": {
"minijasminenode2": "bnorton/minijasminenode"
Expand Down

0 comments on commit 6f896c1

Please sign in to comment.