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

uuidjs

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uuidjs - npm Package Compare versions

Comparing version 4.2.12 to 4.2.13

10

package.json
{
"name": "uuidjs",
"version": "4.2.12",
"version": "4.2.13",
"title": "UUID.js",

@@ -15,3 +15,3 @@ "description": "RFC-compliant UUID Generator for JavaScript",

},
"tonicExampleFilename": "example.js",
"runkitExampleFilename": "example.js",
"scripts": {

@@ -45,5 +45,5 @@ "jsdoc": "rm -rf docs && jsdoc -R README.md -d docs src/uuid.js",

"devDependencies": {
"jsdoc": "^3.6.11",
"qunit": "^2.19.1",
"typescript": "^4.8.4"
"jsdoc": "^4.0.0",
"qunit": "^2.19.3",
"typescript": "^4.9.4"
},

@@ -50,0 +50,0 @@ "browser": {

@@ -135,3 +135,3 @@ # UUID.js - RFC-compliant UUID Generator for JavaScript

Copyright (c) 2010-2022 LiosK
Copyright (c) 2010-2023 LiosK

@@ -138,0 +138,0 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use

@@ -6,4 +6,4 @@ /**

* @author LiosK
* @version v4.2.12
* @license Apache License 2.0: Copyright (c) 2010-2022 LiosK
* @version v4.2.13
* @license Apache License 2.0: Copyright (c) 2010-2023 LiosK
*/

@@ -367,2 +367,44 @@

// UUID Version 6 Component {{{
/**
* Creates a version 6 {@link UUID} object. This function is experimentally
* provided based on the draft RFC and may be changed or removed in the future
* without conforming to semantic versioning requirements.
* @returns {UUID} Version 6 {@link UUID} object.
* @since v4.2.13
* @experimental
*/
UUID.genV6 = function() {
if (UUID._state == null) { UUID.resetState(); }
var now = new Date().getTime(), st = UUID._state;
if (now != st.timestamp) {
if (now < st.timestamp) { st.sequence++; }
st.timestamp = now;
st.tick = UUID._getRandomInt(12); // up to 4095, allowing 5904 tick per msec
} else if (st.tick < 9992) {
// advance sub-millisecond fraction up to 9999 100-nanoseconds
st.tick += 1 + UUID._getRandomInt(3);
} else {
// advance seq if tick overflows in remote chance
st.sequence++;
}
// format time fields
var ts = st.timestamp - Date.UTC(1582, 9, 15);
var th = Math.floor((ts / 0x10000000) * 10000) % 0x100000000;
var midlow = (((ts & 0xFFFFFFF) * 10000) & 0xFFFFFFF) + st.tick;
var tm = midlow >>> 12;
var tlav = (midlow & 0xFFF) | 0x6000; // set version '0110'
// format clock sequence
st.sequence &= 0x3FFF;
var cshar = (st.sequence >>> 8) | 0x80; // set variant '10'
var csl = st.sequence & 0xFF;
return new UUID()._init(th, tm, tlav, cshar, csl, st.node);
};
// }}}
// create local namespace

@@ -369,0 +411,0 @@ function UUID() {}

@@ -11,2 +11,3 @@ import UUID from '..';

const objV1: UUID = UUID.genV1();
const objV6: UUID = UUID.genV6();
const parsed: UUID = UUID.parse(objV4.toString());

@@ -13,0 +14,0 @@

@@ -11,2 +11,3 @@ import * as UUID from '..';

const objV1: UUID.UUID = UUID.genV1();
const objV6: UUID.UUID = UUID.genV6();
const parsed: UUID.UUID = UUID.parse(objV4.toString());

@@ -13,0 +14,0 @@

@@ -11,2 +11,5 @@ /** @deprecated Use class-based API */

/** @deprecated Use class-based API */
export function genV6(): UUID;
/** @deprecated Use class-based API */
export function parse(strId: string): UUID;

@@ -65,2 +68,7 @@

static genV1(): UUIDClass;
/**
* @since v4.2.13
* @experimental
*/
static genV6(): UUIDClass;
static parse(strId: string): UUIDClass;

@@ -67,0 +75,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