Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nanoid

Package Overview
Dependencies
Maintainers
1
Versions
101
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.2 to 3.3.3

19

index.browser.js

@@ -20,7 +20,5 @@ import { urlAlphabet } from './url-alphabet/index.js'

customRandom(alphabet, size, random)
let nanoid = (size = 21) => {
let id = ''
let bytes = crypto.getRandomValues(new Uint8Array(size))
while (size--) {
let byte = bytes[size] & 63
let nanoid = (size = 21) =>
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
byte &= 63
if (byte < 36) {

@@ -30,10 +28,9 @@ id += byte.toString(36)

id += (byte - 26).toString(36).toUpperCase()
} else if (byte < 63) {
} else if (byte > 62) {
id += '-'
} else {
id += '_'
} else {
id += '-'
}
}
return id
}
return id
}, '')
export { nanoid, customAlphabet, customRandom, urlAlphabet, random }

@@ -1,1 +0,1 @@

export let nanoid=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t));for(;t--;){let n=63&r[t];e+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return e};
export let nanoid=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e<63?"_":"-"),"");
{
"name": "nanoid",
"version": "3.3.2",
"description": "A tiny (130 bytes), secure URL-friendly unique string ID generator",
"version": "3.3.3",
"description": "A tiny (116 bytes), secure URL-friendly unique string ID generator",
"keywords": [

@@ -47,2 +47,8 @@ "uuid",

},
"./non-secure/package.json": "./non-secure/package.json",
"./non-secure": {
"require": "./non-secure/index.cjs",
"import": "./non-secure/index.js",
"default": "./non-secure/index.js"
},
"./url-alphabet/package.json": "./url-alphabet/package.json",

@@ -53,10 +59,4 @@ "./url-alphabet": {

"default": "./url-alphabet/index.js"
},
"./non-secure/package.json": "./non-secure/package.json",
"./non-secure": {
"require": "./non-secure/index.cjs",
"import": "./non-secure/index.js",
"default": "./non-secure/index.js"
}
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc