Socket
Socket
Sign inDemoInstall

short-uuid

Package Overview
Dependencies
2
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    short-uuid

Create and translate standard UUIDs with shorter formats.


Version published
Weekly downloads
274K
increased by5.11%
Maintainers
1
Install size
77.0 kB
Created
Weekly downloads
 

Changelog

Source

[2.3.2] - 2017-05-16

Added

  • Added [index.d.ts] TypeScript definitions. No code changes.

Changed

  • Changed [package.json] to reference TypeScript definitions

Readme

Source

short-uuid

Build Status Code Climate Test Coverage Dependencies

Generate and translate standard UUIDs into shorter - or just different - formats and back.

v2.3.2

short-uuid provides RFC4122 v4-compliant UUIDs, thanks to uuid.

It includes Browserify support for client-side use as proposed by voronianski, with compiled browser-ready files in the npm package for convenience. The library is exposed as ShortUUID.

2.3.0 corrects Snyk vulnerability protection to a dev dependency. 2.3.1 merges the 2.1.x fixes into version history. 2.3.2 merges a TypeScript definition from alexturek.

v2.2.0 Deprecated

2.2.0 incorrectly added Snyk as a production dependency. It has been deprecated.

var short = require('short-uuid');
var translator = short(); // Defaults to flickrBase58
var decimalTranslator = short("0123456789"); // Provide a specific alphabet for translation
var cookieTranslator = short(short.constants.cookieBase90); // Use a constant for translation

// Generate a shortened v4 UUID
translator.new();

// Generate plain UUIDs
short.uuid(); // From the constructor without creating a translator
translator.uuid(); // Each translator provides the uuid.v4() function

// Translate UUIDs
translator.toUUID(shortId);
translator.fromUUID(regularUUID);

// See the alphabet used by a translator
translator.alphabet

// View the constants
short.constants.flickrBase58;
short.constants.cookieBase90;

v2.3.1 is under 1K when compressed. Using Browserify, the library and dependencies are ~3.2K.

Please see Revisions for information on previous versions.

Keywords

FAQs

Last updated on 16 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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