nanoid 2.1.8 → 2.1.9

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.1.9
5
+ * Reduce `format` and `async/format` size (by Dair Aidarkhanov).
6
+
4
7
  ## 2.1.8
5
8
  * Improve React docs (by Nahum Zsilva).
6
9
 
@@ -1,6 +1,6 @@
1
1
  module.exports = function (random, alphabet, size) {
2
2
  var mask = (2 << 31 - Math.clz32((alphabet.length - 1) | 1)) - 1
3
- var step = Math.ceil(1.6 * mask * size / alphabet.length)
3
+ var step = -~(1.6 * mask * size / alphabet.length)
4
4
 
5
5
  function tick (id) {
6
6
  return random(step).then(function (bytes) {
package/format.browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (random, alphabet, size) {
2
2
  var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1
3
- var step = Math.ceil(1.6 * mask * size / alphabet.length)
3
+ var step = -~(1.6 * mask * size / alphabet.length)
4
4
  var id = ''
5
5
 
6
6
  while (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nanoid",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "A tiny (137 bytes), secure URL-friendly unique string ID generator",
5
5
  "keywords": [
6
6
  "uuid",