Socket
Socket
Sign inDemoInstall

uuid-tool

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

7

dist/index.js

@@ -1,2 +0,2 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);
/**

@@ -7,3 +7,4 @@ * UUID

* @license Apache-2.0
*/Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){"string"==typeof t&&36===t.length?this.fromString(t):"object"==typeof t&&16===t.length?this.fromBytes(t):this.generate()}return t.prototype.generate=function(){var t=new Array(16).fill(0).map(function(){return 255*Math.random()&255});return t[6]=79&(64|t[6]),this.fromBytes(t),this},t.prototype.fromBytes=function(t){return this.value=t.map(function(t){return("00"+t.toString(16)).slice(-2)}).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5").toUpperCase(),this},t.prototype.toBytes=function(){return this.value.replace(/-/g,"").match(/.{2}/g).map(function(t){return parseInt(t,16)})},t.prototype.fromString=function(t){return this.value=t,this},t.prototype.toString=function(){return this.value},t.prototype.isValid=function(){return"string"==typeof this.value&&36===this.value.length&&t.REGEX.UUID.test(this.value)},t.REGEX={UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i},t}();e.UUID=r},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),r(n(2)),r(n(0))},function(t,e,n){"use strict";
*/
var r=function(){function t(t){this.value="","string"==typeof t&&36===t.length?this.fromString(t):"object"==typeof t&&16===t.length?this.fromBytes(t):this.generate()}return t.prototype.generate=function(){var t=new Array(16).fill(0).map(function(){return 255*Math.random()&255});return t[6]=79&(64|t[6]),this.fromBytes(t),this},t.prototype.fromBytes=function(t){return this.value=t.map(function(t){return("00"+t.toString(16)).slice(-2)}).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5").toUpperCase(),this},t.prototype.toBytes=function(){return(this.value.replace(/-/g,"").match(/.{2}/g)||[]).map(function(t){return parseInt(t,16)})},t.prototype.fromString=function(t){return this.value=t,this},t.prototype.toString=function(){return this.value},t.prototype.isValid=function(){return"string"==typeof this.value&&36===this.value.length&&t.REGEX.UUID.test(this.value)},t.REGEX={UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i},t}(),o=function(){function t(){}return t.toBytes=function(t){return(new r).fromString(t).toBytes()},t.toString=function(t){return(new r).fromBytes(t).toString()},t.newUUID=function(){return(new r).toString()},t.isUUID=function(t){return(new r).fromString(t).isValid()},t}();
/**

@@ -14,2 +15,2 @@ * UUID Tool

* @license Apache-2.0
*/Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=function(){function t(){}return t.toBytes=function(t){return(new r.UUID).fromString(t).toBytes()},t.toString=function(t){return(new r.UUID).fromBytes(t).toString()},t.newUUID=function(){return(new r.UUID).toString()},t.isUUID=function(t){return(new r.UUID).fromString(t).isValid()},t}();e.UUIDTool=o}])});
*/n.d(e,"UUIDTool",function(){return o}),n.d(e,"UUID",function(){return r})}])});
{
"name": "uuid-tool",
"version": "1.1.0",
"version": "1.2.0",
"description": "Parse and generate UUIDs. Convert between UUID string (36 byte) to 16 byte array.",

@@ -10,3 +10,5 @@ "keywords": [

"byte",
"array"
"array",
"node",
"browser"
],

@@ -13,0 +15,0 @@ "author": "Dominik-Andreas Geng",

@@ -6,2 +6,4 @@ # UUID Tool

For NodeJS and Browser.
UUID RFC 4122 Version 4

@@ -12,3 +14,3 @@

```bash
npm i -S uuid-tool
npm i uuid-tool
```

@@ -33,2 +35,9 @@

In NodeJS e.g.
```js
const UUID = require('uuid-tool').UUID;
console.log(new UUID().toString());
```
## API

@@ -35,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc