Comparing version
@@ -16,6 +16,6 @@ | ||
function create(chars) { | ||
assert(typeof chars === 'string') | ||
assert(typeof chars === 'string', 'the list of characters must be a string!') | ||
var length = Buffer.byteLength(chars) | ||
return function rndm(len) { | ||
assert(typeof len === 'number' && len >= 0) | ||
assert(typeof len === 'number' && len >= 0, 'the length of the random string must be a number!') | ||
var salt = '' | ||
@@ -22,0 +22,0 @@ for (var i = 0; i < len; i++) salt += chars[Math.floor(length * Math.random())] |
{ | ||
"name": "rndm", | ||
"description": "random string generator", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
3100
3.23%