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

uuid-int

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uuid-int - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

myobject.cc

23

addon.js

@@ -1,3 +0,22 @@

var Generator = require('bindings')('addon.node');
const Generator = require('bindings')('addon.node');
module.exports = (id, seed = 0) => Generator(id, seed);
module.exports = (id, seed = 0) => {
if (typeof id !== 'number') {
throw Error('id need be number');
}
if (typeof seed !== 'number') {
throw Error('seed need be number');
}
id = parseInt(id);
seed = parseInt(seed);
if (id < 0 || id > 511) {
throw Error('d must be >=0 or <= 511');
}
if (seed < 0 || seed * 1000 > Date.now()) {
throw Error('seed must <= now');
}
const gen = Generator(id, seed);
gen.id = id;
gen.seed = seed;
return gen;
};

5

package.json
{
"name": "uuid-int",
"version": "1.2.0",
"version": "2.0.0",
"description": "uuid-int for nodejs",

@@ -23,4 +23,3 @@ "main": "addon.js",

"dependencies": {
"bindings": "^1.5.0",
"node-addon-api": "^1.6.3"
"bindings": "^1.5.0"
},

@@ -27,0 +26,0 @@ "homepage": "https://github.com/wbget/uuid-int",

@@ -27,3 +27,3 @@ [![NPM version][npm-image]][npm-url]

Install
__Install__

@@ -34,5 +34,12 @@ ```

Use
__Windows install__
```
npm install --global --production windows-build-tools
npm install --save uuid-int
```
__Use__
```
const UUID = require('uuid-int');

@@ -39,0 +46,0 @@

@@ -12,3 +12,7 @@ # uuid-int

```
windows下安装
```
npm install --global --production windows-build-tools
npm install --save uuid-int
```
使用

@@ -15,0 +19,0 @@

Sorry, the diff of this file is not supported yet

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