base62-random
Advanced tools
Comparing version 0.2.0 to 0.3.0-1
@@ -16,5 +16,2 @@ 'use strict'; | ||
// Binary uuids (even faster) | ||
// Test for uuid | ||
@@ -115,3 +112,3 @@ base62.test = isbase62 | ||
function base62(length) { | ||
if ( !length || typeof length !== 'number') throw new Error(`base62 length must be a number "${length}"`) | ||
if ( !length || typeof length !== 'number') throw new Error('base62 length must be a number "'+length+'"') | ||
if ( str.length < (strIdx+length) ) generateBase62() | ||
@@ -118,0 +115,0 @@ return str.slice(strIdx, (strIdx+=length)) |
{ | ||
"name": "base62-random", | ||
"version": "0.2.0", | ||
"version": "0.3.0-1", | ||
"description": "Fast base62 random", | ||
"main": "index.js", | ||
"scripts": { | ||
"minify": "uglifyjs index.js -mco base62-random.min.js", | ||
"test": "mocha test/unit* test/perf*", | ||
@@ -32,4 +33,5 @@ "test:coverage": "istanbul cover _mocha test/unit* && istanbul check-coverage", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.5.2" | ||
"mocha": "^3.5.2", | ||
"uglify-js": "^3.1.3" | ||
} | ||
} |
@@ -30,3 +30,3 @@ # base62-random | ||
<script> | ||
base62(13); // 'BAhl1V1BfUmo' | ||
base62(13); // 'BAhl1V1BfUmo3' | ||
</script> | ||
@@ -33,0 +33,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
45916
7
5
99
2