Socket
Socket
Sign inDemoInstall

uid2

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

16

index.js

@@ -14,2 +14,14 @@ /**

/**
* Make a Base64 string ready for use in URLs
*
* @param {String}
* @returns {String}
* @api private
*/
function urlReady(str) {
return str.replace(/\+/g, '_').replace(/\//g, '-');
}
/**
* Generate an Unique Id

@@ -25,7 +37,7 @@ *

if (typeof cb === 'undefined') {
return crypto.randomBytes(numbytes).toString('base64').slice(0, length);
return urlReady(crypto.randomBytes(numbytes).toString('base64').slice(0, length));
} else {
crypto.randomBytes(numbytes, function(err, bytes) {
if (err) return cb(err);
cb(null, bytes.toString('base64').slice(0, length));
cb(null, urlReady(bytes.toString('base64').slice(0, length)));
})

@@ -32,0 +44,0 @@ }

2

package.json

@@ -5,5 +5,5 @@ {

"tags": ["uid"],
"version": "0.0.1",
"version": "0.0.2",
"dependencies": {
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc