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

cuid

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cuid - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

15

dist/browser-cuid.js

@@ -33,2 +33,8 @@ /**

safeCounter = function () {
c = (c < discreteValues) ? c : 0;
c++; // this is not subliminal
return c - 1;
},
api = function cuid() {

@@ -55,7 +61,4 @@ // Starting with a lowercase letter makes

c = (c < discreteValues) ? c : 0;
counter = pad(c.toString(base), blockSize);
counter = pad(safeCounter().toString(base), blockSize);
c++; // this is not subliminal
return (letter + timestamp + counter + fingerprint + random);

@@ -66,3 +69,3 @@ };

var date = new Date().getTime().toString(36),
counter = c.toString(36).slice(-1),
counter,
print = api.fingerprint().slice(0,1) +

@@ -72,3 +75,3 @@ api.fingerprint().slice(-1),

c++;
counter = safeCounter().toString(36).slice(-1);

@@ -75,0 +78,0 @@ return date.slice(2,4) + date.slice(-2) +

@@ -33,2 +33,8 @@ /**

safeCounter = function () {
c = (c < discreteValues) ? c : 0;
c++; // this is not subliminal
return c - 1;
},
api = function cuid() {

@@ -55,7 +61,4 @@ // Starting with a lowercase letter makes

c = (c < discreteValues) ? c : 0;
counter = pad(c.toString(base), blockSize);
counter = pad(safeCounter().toString(base), blockSize);
c++; // this is not subliminal
return (letter + timestamp + counter + fingerprint + random);

@@ -66,3 +69,3 @@ };

var date = new Date().getTime().toString(36),
counter = c.toString(36).slice(-1),
counter,
print = api.fingerprint().slice(0,1) +

@@ -72,3 +75,3 @@ api.fingerprint().slice(-1),

c++;
counter = safeCounter().toString(36).slice(-1);

@@ -75,0 +78,0 @@ return date.slice(2,4) + date.slice(-2) +

4

package.json
{
"name": "cuid",
"version": "1.2.1",
"version": "1.2.2",
"description": "Collision-resistant ids optimized for horizontal scaling and performance. For node and browsers.",

@@ -9,3 +9,3 @@ "author": {

"url": "http://ericleads.com"
},
},
"main": "./dist/node-cuid.js",

@@ -12,0 +12,0 @@ "browserify": "./dist/browser-cuid.js",

@@ -33,2 +33,8 @@ /**

safeCounter = function () {
c = (c < discreteValues) ? c : 0;
c++; // this is not subliminal
return c-1;
},
api = function cuid() {

@@ -55,7 +61,4 @@ // Starting with a lowercase letter makes

c = (c < discreteValues) ? c : 0;
counter = pad(c.toString(base), blockSize);
counter = pad(safeCounter().toString(base), blockSize);
c++; // this is not subliminal
return (letter + timestamp + counter + fingerprint + random);

@@ -66,3 +69,3 @@ };

var date = new Date().getTime().toString(36),
counter = c.toString(36).slice(-1),
counter,
print = api.fingerprint().slice(0,1) +

@@ -72,3 +75,3 @@ api.fingerprint().slice(-1),

c++;
counter = safeCounter().toString(36).slice(-1);

@@ -75,0 +78,0 @@ return date.slice(2,4) + date.slice(-2) +

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