Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ai/nanoid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.8
Choose a base ref
...
head repository: ai/nanoid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.1.9
Choose a head ref
  • 4 commits
  • 6 files changed
  • 2 contributors

Commits on Jan 7, 2020

  1. Replace Math.ceil with the bit operation (#161)

    * Replace Math.ceil with the bit operation
    
    * Reverse the change with bit operation
    
    * Reverse the change with bit operation
    telesvar authored and ai committed Jan 7, 2020

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    7a32491 View commit details
  2. Update dependencies

    ai committed Jan 7, 2020
    Copy the full SHA
    83d2f32 View commit details
  3. Try to fix CI

    ai committed Jan 7, 2020
    Copy the full SHA
    d01f53a View commit details
  4. Release 2.1.9 version

    ai committed Jan 7, 2020
    Copy the full SHA
    b24c2bb View commit details
Showing with 316 additions and 302 deletions.
  1. +2 −0 .travis.yml
  2. +3 −0 CHANGELOG.md
  3. +1 −1 async/format.browser.js
  4. +1 −1 format.browser.js
  5. +11 −11 package.json
  6. +298 −289 yarn.lock
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -5,3 +5,5 @@ node_js:
- "12"
- "10"
- "8"
install:
- yarn install --ignore-engines
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).

## 2.1.9
* Reduce `format` and `async/format` size (by Dair Aidarkhanov).

## 2.1.8
* Improve React docs (by Nahum Zsilva).

2 changes: 1 addition & 1 deletion async/format.browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (random, alphabet, size) {
var mask = (2 << 31 - Math.clz32((alphabet.length - 1) | 1)) - 1
var step = Math.ceil(1.6 * mask * size / alphabet.length)
var step = -~(1.6 * mask * size / alphabet.length)

function tick (id) {
return random(step).then(function (bytes) {
2 changes: 1 addition & 1 deletion format.browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (random, alphabet, size) {
var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1
var step = Math.ceil(1.6 * mask * size / alphabet.length)
var step = -~(1.6 * mask * size / alphabet.length)
var id = ''

while (true) {
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nanoid",
"version": "2.1.8",
"version": "2.1.9",
"description": "A tiny (137 bytes), secure URL-friendly unique string ID generator",
"keywords": [
"uuid",
@@ -31,28 +31,28 @@
},
"sideEffects": false,
"devDependencies": {
"@logux/eslint-config": "^35.0.1",
"@logux/eslint-config": "^35.0.3",
"@logux/sharec-config": "^0.5.6",
"@size-limit/preset-small-lib": "^2.2.2",
"@size-limit/preset-small-lib": "^2.2.4",
"benchmark": "^2.1.4",
"chalk": "^3.0.0",
"clean-publish": "^1.1.4",
"documentation": "^12.1.4",
"eslint": "^6.7.2",
"eslint": "^6.8.0",
"eslint-ci": "^1.0.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-es5": "^1.4.1",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jest": "^23.1.1",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-jest": "^23.3.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prefer-let": "^1.0.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^14.0.1",
"geneticalgorithm": "^1.0.1",
"eslint-plugin-unicorn": "^15.0.1",
"geneticalgorithm": "^1.0.2",
"gzip-size": "^5.1.1",
"husky": "^3.1.0",
"husky": "^4.0.0",
"jest": "^24.9.0",
"lint-staged": "^9.5.0",
"parcel-bundler": "^1.12.4",
@@ -62,7 +62,7 @@
"shortid": "^2.2.15",
"uid-safe": "^2.1.5",
"uuid": "^3.3.3",
"webpack": "^4.41.2",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
"yaspeller-ci": "^1.0.1"
},
@@ -73,7 +73,7 @@
},
{
"path": "generate.js",
"limit": "170 B"
"limit": "168 B"
},
{
"path": "url.js",
Loading