nanoid 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 2.0.3
5
+ * Fix freeze on string in ID length.
6
+
4
7
  ## 2.0.2
5
8
  * Improve docs (by Sylvanus Kateile and Mark Stosberg).
6
9
 
package/async/format.js CHANGED
@@ -31,6 +31,7 @@
31
31
  module.exports = function (random, alphabet, size) {
32
32
  var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1
33
33
  var step = Math.ceil(1.6 * mask * size / alphabet.length)
34
+ size = +size
34
35
 
35
36
  function tick (id) {
36
37
  return random(step).then(function (bytes) {
package/format.js CHANGED
@@ -29,6 +29,7 @@
29
29
  module.exports = function (random, alphabet, size) {
30
30
  var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1
31
31
  var step = Math.ceil(1.6 * mask * size / alphabet.length)
32
+ size = +size
32
33
 
33
34
  var id = ''
34
35
  while (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nanoid",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A tiny (141 bytes), secure URL-friendly unique string ID generator",
5
5
  "keywords": [
6
6
  "uuid",