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

short-uuid

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

short-uuid - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

4

dist/short-uuid.js

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

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ShortUUID = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ShortUUID = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
/**

@@ -46,4 +46,2 @@ * Created by Samuel on 6/4/2016.

module.exports = (function(){

@@ -50,0 +48,0 @@

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

/*! short-uuid v3.0.0 - 2018-03-24 */
/*! short-uuid v3.0.1 - 2018-10-17 */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ShortUUID=t()}}(function(){return function i(u,f,a){function s(n,t){if(!f[n]){if(!u[n]){var r="function"==typeof require&&require;if(!t&&r)return r(n,!0);if(c)return c(n,!0);var e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}var o=f[n]={exports:{}};u[n][0].call(o.exports,function(t){var r=u[n][1][t];return s(r||t)},o,o.exports,i,u,f,a)}return f[n].exports}for(var c="function"==typeof require&&require,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(t,r,n){var o=t("any-base"),i=t("uuid/v4"),u="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";function f(t,r){return r(t.toLowerCase().replace(/-/g,""))}r.exports=function(){function t(t){var r=t||u,n=o(o.HEX,r),e=o(r,o.HEX);return{new:function(){return f(i(),n)},uuid:i,fromUUID:function(t){return f(t,n)},toUUID:function(t){return function(t,r){for(var n,e=r(t),o="",i=0,u=32-e.length;i<u;++i)o+="0";return[(n=(o+e).match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/))[1],n[2],n[3],n[4],n[5]].join("-")}(t,e)},alphabet:r}}return t.constants={flickrBase58:u,cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~"},t.uuid=i,t}()},{"any-base":2,"uuid/v4":6}],2:[function(t,r,n){var e=t("./src/converter");function o(t,r){var n=new e(t,r);return function(t){return n.convert(t)}}o.BIN="01",o.OCT="01234567",o.DEC="0123456789",o.HEX="0123456789abcdef",r.exports=o},{"./src/converter":3}],3:[function(t,r,n){"use strict";function e(t,r){if(!(t&&r&&t.length&&r.length))throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}e.prototype.convert=function(t){var r,n,e,o={},i=this.srcAlphabet.length,u=this.dstAlphabet.length,f=t.length,a="string"==typeof t?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<f;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(r=e=n=0;r<f;r++)u<=(n=n*i+o[r])?(o[e++]=parseInt(n/u,10),n%=u):0<e&&(o[e++]=0);f=e,a=this.dstAlphabet.slice(n,n+1).concat(a)}while(0!==e);return a},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(-1===this.srcAlphabet.indexOf(t[r]))return!1;return!0},r.exports=e},{}],4:[function(t,r,n){for(var o=[],e=0;e<256;++e)o[e]=(e+256).toString(16).substr(1);r.exports=function(t,r){var n=r||0,e=o;return e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]}},{}],5:[function(t,r,n){var e="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(e){var o=new Uint8Array(16);r.exports=function(){return e(o),o}}else{var i=new Array(16);r.exports=function(){for(var t,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),i[r]=t>>>((3&r)<<3)&255;return i}}},{}],6:[function(t,r,n){var u=t("./lib/rng"),f=t("./lib/bytesToUuid");r.exports=function(t,r,n){var e=r&&n||0;"string"==typeof t&&(r="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||u)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r)for(var i=0;i<16;++i)r[e+i]=o[i];return r||f(o)}},{"./lib/bytesToUuid":4,"./lib/rng":5}]},{},[1])(1)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ShortUUID=t()}}(function(){return function i(u,f,a){function s(r,t){if(!f[r]){if(!u[r]){var n="function"==typeof require&&require;if(!t&&n)return n(r,!0);if(c)return c(r,!0);var e=new Error("Cannot find module '"+r+"'");throw e.code="MODULE_NOT_FOUND",e}var o=f[r]={exports:{}};u[r][0].call(o.exports,function(t){return s(u[r][1][t]||t)},o,o.exports,i,u,f,a)}return f[r].exports}for(var c="function"==typeof require&&require,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(t,r,n){var o=t("any-base"),i=t("uuid/v4"),u="123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";function f(t,r){return r(t.toLowerCase().replace(/-/g,""))}r.exports=function(){function t(t){var r=t||u,n=o(o.HEX,r),e=o(r,o.HEX);return{new:function(){return f(i(),n)},uuid:i,fromUUID:function(t){return f(t,n)},toUUID:function(t){return function(t,r){for(var n,e=r(t),o="",i=0,u=32-e.length;i<u;++i)o+="0";return[(n=(o+e).match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/))[1],n[2],n[3],n[4],n[5]].join("-")}(t,e)},alphabet:r}}return t.constants={flickrBase58:u,cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~"},t.uuid=i,t}()},{"any-base":2,"uuid/v4":6}],2:[function(t,r,n){var e=t("./src/converter");function o(t,r){var n=new e(t,r);return function(t){return n.convert(t)}}o.BIN="01",o.OCT="01234567",o.DEC="0123456789",o.HEX="0123456789abcdef",r.exports=o},{"./src/converter":3}],3:[function(t,r,n){"use strict";function e(t,r){if(!(t&&r&&t.length&&r.length))throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}e.prototype.convert=function(t){var r,n,e,o={},i=this.srcAlphabet.length,u=this.dstAlphabet.length,f=t.length,a="string"==typeof t?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<f;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(r=e=n=0;r<f;r++)u<=(n=n*i+o[r])?(o[e++]=parseInt(n/u,10),n%=u):0<e&&(o[e++]=0);f=e,a=this.dstAlphabet.slice(n,n+1).concat(a)}while(0!==e);return a},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(-1===this.srcAlphabet.indexOf(t[r]))return!1;return!0},r.exports=e},{}],4:[function(t,r,n){for(var o=[],e=0;e<256;++e)o[e]=(e+256).toString(16).substr(1);r.exports=function(t,r){var n=r||0,e=o;return e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+"-"+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]+e[t[n++]]}},{}],5:[function(t,r,n){var e="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(e){var o=new Uint8Array(16);r.exports=function(){return e(o),o}}else{var i=new Array(16);r.exports=function(){for(var t,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),i[r]=t>>>((3&r)<<3)&255;return i}}},{}],6:[function(t,r,n){var u=t("./lib/rng"),f=t("./lib/bytesToUuid");r.exports=function(t,r,n){var e=r&&n||0;"string"==typeof t&&(r="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||u)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r)for(var i=0;i<16;++i)r[e+i]=o[i];return r||f(o)}},{"./lib/bytesToUuid":4,"./lib/rng":5}]},{},[1])(1)});
{
"name": "short-uuid",
"version": "3.0.0",
"version": "3.0.1",
"description": "Create and translate standard UUIDs with shorter formats.",

@@ -35,6 +35,5 @@ "main": "index.js",

"devDependencies": {
"codeclimate-test-reporter": "^0.5.0",
"grunt": "^1.0.2",
"grunt-browserify": "^5.2.0",
"grunt-contrib-uglify": "^3.3.0",
"grunt": "^1.0.3",
"grunt-browserify": "^5.3.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-mkdir": "^1.0.0",

@@ -44,6 +43,6 @@ "grunt-mocha-istanbul": "^5.0.2",

"istanbul": "^0.4.5",
"mocha": "^5.0.5",
"snyk": "^1.70.3"
"mocha": "^5.1.1",
"snyk": "^1.80.0"
},
"snyk": true
}
# short-uuid
[![npm](https://img.shields.io/npm/v/short-uuid.svg)](https://www.npmjs.com/package/short-uuid)

@@ -6,3 +7,4 @@ [![Build Status](https://travis-ci.org/oculus42/short-uuid.svg?branch=master)](https://travis-ci.org/oculus42/short-uuid)

[![Test Coverage](https://codeclimate.com/github/oculus42/short-uuid/badges/coverage.svg)](https://codeclimate.com/github/oculus42/short-uuid/coverage)
[![Dependencies](https://david-dm.org/oculus42/short-uuid.svg)](https://david-dm.org/oculus42/short-uuid)
[![Dependencies](https://david-dm.org/oculus42/short-uuid.svg)](https://david-dm.org/oculus42/short-uuid)
[![Greenkeeper badge](https://badges.greenkeeper.io/oculus42/short-uuid.svg)](https://greenkeeper.io/)

@@ -54,3 +56,3 @@ Generate and translate standard UUIDs into shorter - or just *different* - formats and back.

2.3.3 fixes missing /dist folder from the npm module.
2.3.4 corrects the behavior for UUIDs with uppercase letters.
2.3.4 corrects the behavior for UUIDs with uppercase letters.
3.0.0 updates dependencies, includes a refactor for CodeClimate, and drops Node 0.x support.

@@ -57,0 +59,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