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.0 to 3.3.1

26

index.browser.js
import { urlAlphabet } from './url-alphabet/index.js'
if (process.env.NODE_ENV !== 'production') {
if (
typeof navigator !== 'undefined' &&
navigator.product === 'ReactNative' &&
typeof crypto === 'undefined'
) {
throw new Error(
'React Native does not have a built-in secure random generator. ' +
'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +
'For secure IDs, import `react-native-get-random-values` ' +
'before Nano ID.'
)
}
if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {
throw new Error(
'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +
' before importing Nano ID to fix IE 11 support'
)
}
if (typeof crypto === 'undefined') {
throw new Error(
'Your browser does not have secure random generator. ' +
'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'
)
}
}
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))

@@ -29,0 +3,0 @@ let customRandom = (alphabet, defaultSize, getRandom) => {

8

package.json
{
"name": "nanoid",
"version": "3.3.0",
"version": "3.3.1",
"description": "A tiny (130 bytes), secure URL-friendly unique string ID generator",

@@ -32,7 +32,3 @@ "keywords": [

".": {
"browser": {
"development": "./index.dev.js",
"production": "./index.prod.js",
"default": "./index.prod.js"
},
"browser": "./index.browser.js",
"require": "./index.cjs",

@@ -39,0 +35,0 @@ "import": "./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