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

uid-safe

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uid-safe - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

15

index.js
var crypto = require('crypto')
var mz_crypto = require('mz/crypto')
var pseudoRandomBytes = require('crypto').pseudoRandomBytes
var escape = require('base64-url').escape
var pseudoRandomBytesProm
module.exports = uid

@@ -10,3 +11,3 @@

if (cb) {
return crypto.pseudoRandomBytes(length, function (err, buf) {
return pseudoRandomBytes(length, function (err, buf) {
if (err) return cb(err)

@@ -16,7 +17,9 @@ cb(null, escapeBuffer(buf))

}
return mz_crypto.pseudoRandomBytes(length).then(escapeBuffer)
pseudoRandomBytesProm || (pseudoRandomBytesProm = require('mz/crypto').pseudoRandomBytes)
return pseudoRandomBytesProm(length).then(escapeBuffer)
}
uid.sync = function (length) {
return escapeBuffer(crypto.pseudoRandomBytes(length))
uid.sync = function uid_sync(length) {
return escapeBuffer(pseudoRandomBytes(length))
}

@@ -23,0 +26,0 @@

8

package.json
{
"name": "uid-safe",
"description": "URL and cookie safe UIDs",
"version": "1.0.0",
"version": "1.0.1",
"author": {

@@ -12,9 +12,9 @@ "name": "Jonathan Ong",

"license": "MIT",
"repository": "jonathanong/uid-safe",
"repository": "crypto-utils/uid-safe",
"dependencies": {
"mz": "0",
"bluebird": "2",
"mz": "1",
"base64-url": "1"
},
"devDependencies": {
"bluebird": "2",
"mocha": "1"

@@ -21,0 +21,0 @@ },

@@ -23,2 +23,5 @@

If `cb` is not defined, a promise is returned.
However, to use promises, you must either install [bluebird](https://github.com/petkaantonov/bluebird)
or use a version of node.js that has native promises,
otherwise your process will crash and die.

@@ -25,0 +28,0 @@ ```js

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