Skip to content

Commit

Permalink
2.1.2 updates
Browse files Browse the repository at this point in the history
Switch to uuid package. Improves browserify compression.
  • Loading branch information
oculus42 committed Dec 1, 2016
1 parent f979647 commit 386eeba
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.2] - 2016-11-30
### Changed
- Updated from `node-uuid` to `uuid`, per the author
- Switched to using only `uuid/v4` for a smaller footprint

## [2.1.1] - 2016-11-13
### Added
- Add dist files to npm package
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

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

## v2.1.1
## v2.1.2

2.1.0 adds Browserify config to support client-side use as proposed by [voronianski](https://github.com/voronianski).
2.1.1 includes compiled browser-ready files in the npm package for convenience. The library is exposed as `ShortUUID`.
2.1.2 switches to the modular `uuid` library.

short-uuid provides RFC4122 v4-compliant UUIDs,
thanks to [`node-uuid`](https://github.com/broofa/node-uuid).
thanks to [`uuid`](https://github.com/kelektiv/node-uuid).

```javascript
var short = require('short-uuid');
Expand Down Expand Up @@ -40,6 +41,6 @@ short.constants.cookieBase90;

```

v2.1.0 is under 1K when compressed. Using Browserify, the library and dependencies are less than 5K.
v2.1.2 is under 1K when compressed. Using Browserify, the library and dependencies are less than 4K.

Please see [Revisions](revisions.md) for information on previous versions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module.exports = (function(){

var anyBase = require('any-base');
var uuid = require('uuid');
var uuidV4 = require('uuid/v4');

var flickrBase58 = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
var cookieBase90 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~";
Expand Down Expand Up @@ -62,8 +62,8 @@ module.exports = (function(){
var toHex = anyBase(useAlphabet, anyBase.HEX);

return {
new: function() { return shortenUUID(uuid.v4(), fromHex); },
uuid: uuid.v4,
new: function() { return shortenUUID(uuidV4(), fromHex); },
uuid: uuidV4,
fromUUID: function(uuid) { return shortenUUID(uuid, fromHex); },
toUUID: function(shortUuid) { return enlargeUUID(shortUuid, toHex); },
alphabet: useAlphabet
Expand All @@ -77,7 +77,7 @@ module.exports = (function(){
};

// Expose the generic v4 UUID generator for convenience
MakeConvertor.uuid = uuid.v4;
MakeConvertor.uuid = uuidV4;

return MakeConvertor;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "short-uuid",
"version": "2.1.1",
"version": "2.1.2",
"description": "Create and translate standard UUIDs with shorter formats.",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions revisions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revisions

# v2.1.2

2.1.2 changes to `uuid` 3.0.0 and uses only the `uuid/v4` module.

# v2.1.1

2.1.1 includes the compiled Browserify files in the npm package for convenience.
Expand Down

0 comments on commit 386eeba

Please sign in to comment.