🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

nanoid

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoid - npm Package Compare versions

Comparing version
3.3.13
to
3.3.14
+13
-8
index.js

@@ -6,10 +6,15 @@ import crypto from 'crypto'

let fillPool = bytes => {
if (bytes < 0 || bytes > 1024) throw new RangeError('Wrong ID size')
if (!pool || pool.length < bytes) {
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
crypto.randomFillSync(pool)
poolOffset = 0
} else if (poolOffset + bytes > pool.length) {
crypto.randomFillSync(pool)
poolOffset = 0
if (bytes < 0) throw new RangeError('Wrong ID size')
try {
if (!pool || pool.length < bytes) {
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)
crypto.randomFillSync(pool)
poolOffset = 0
} else if (poolOffset + bytes > pool.length) {
crypto.randomFillSync(pool)
poolOffset = 0
}
} catch (e) {
pool = undefined
throw e
}

@@ -16,0 +21,0 @@ poolOffset += bytes

{
"name": "nanoid",
"version": "3.3.13",
"version": "3.3.14",
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",

@@ -5,0 +5,0 @@ "keywords": [