New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@brainsights/uuid

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brainsights/uuid - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

21

index.js

@@ -5,5 +5,7 @@ const debug = require("debug")("@brainsights/brainlab-uuid");

const uuidBase62 = require("uuid-base62");
const UUID_SIZE_BYTES = 16;
const UUID_LONG_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
const UUID_SHORT_REGEX = /^[0-9a-zA-Z_\-]{22}$/;
const UUID_SHORT_REGEX = /^[0-9a-zA-Z]{22}$/;

@@ -71,11 +73,12 @@ // Maps for number <-> hex string conversion

__.set(this, {
buffer: buffer
buffer: buffer,
value: null,
});
if(undefined == s) {
uuid.v4(null, buffer);
__.get(this).value = uuidBase62.v4();
} else if(Uuid.isLong(s)) {
parse(s, buffer);
__.get(this).value = uuidBase62.encode(s);
} else if(Uuid.isShort(s)) {
buffer.write(b64u_to_b64(s), "base64");
__.get(this).value = s;
} else {

@@ -101,5 +104,5 @@ throw new Error("unrecognized UUID string:", s);

get base64url()
get base62()
{
return b64_to_b64u(__.get(this).buffer.toString("base64"));
return __.get(this).value;
}

@@ -109,3 +112,3 @@

{
return unparse(__.get(this).buffer);
return uuidBase62.decode(__.get(this).value);
}

@@ -130,3 +133,3 @@

{
return (new Uuid(s)).base64url;
return (new Uuid(s)).base62;
}

@@ -133,0 +136,0 @@ }

{
"name": "@brainsights/uuid",
"version": "1.2.0",
"version": "1.3.0",
"description": "Tools for working with UUIDs for Brainlab",

@@ -17,4 +17,5 @@ "main": "index.js",

"should": "^11.2.1",
"uuid": "^3.0.1"
"uuid": "^3.0.1",
"uuid-base62": "0.1.0"
}
}
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