nanoid 5.0.7 → 5.0.8
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.
Potentially problematic release.
This version of nanoid might be problematic. Click here for more details.
- package/README.md +1 -1
- package/index.browser.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -25,7 +25,7 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"
|
|
25
25
|
|
26
26
|
---
|
27
27
|
|
28
|
-
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Made
|
28
|
+
<img src="https://cdn.evilmartians.com/badges/logo-no-label.svg" alt="" width="22" height="16" /> Made at <b><a href="https://evilmartians.com/devtools?utm_source=nanoid&utm_campaign=devtools-button&utm_medium=github">Evil Martians</a></b>, product consulting for <b>developer tools</b>.
|
29
29
|
|
30
30
|
---
|
31
31
|
|
package/index.browser.js
CHANGED
@@ -2,7 +2,7 @@ import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'
|
|
2
2
|
export { urlAlphabet } from './url-alphabet/index.js'
|
3
3
|
export let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
|
4
4
|
export let customRandom = (alphabet, defaultSize, getRandom) => {
|
5
|
-
let mask = (2 <<
|
5
|
+
let mask = (2 << Math.log2(alphabet.length - 1)) - 1
|
6
6
|
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
|
7
7
|
return (size = defaultSize) => {
|
8
8
|
let id = ''
|