Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updates the base64 example
  • Loading branch information
dmarcelino committed Jun 1, 2015
1 parent 11f6249 commit eec89b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Base62 non-sequential url-friendly UUID generator (RFC4122)

## Overview

uuid-base62 makes it easy to generate short base62 (or any other base) UUIDs. The unencoded UUIDs are generated by [node-uuid](https://github.com/broofa/node-uuid) which follows [RFC4122](http://www.ietf.org/rfc/rfc4122.txt).
uuid-base62 makes it easy to generate short base62 (or any other base) UUIDs. The unencoded UUIDs are generated by [node-uuid](https://github.com/broofa/node-uuid) which follows [RFC4122](http://www.ietf.org/rfc/rfc4122.txt). The encoded UUIDs are alphanumeric [0-9a-zA-Z] and always have a length of 22 chars.

## Instalation
```shell
Expand All @@ -30,11 +30,14 @@ var encoded = uuidBase62.encode('8fc60e7c-3b3c-48e9-a6a7-a5fe4f1fbc31');
// -> 2fNwVYePN8WqqDFvVf7XMN
```

That's it. node-base62 also supports other bases, example for base64:
That's it. uuid-base62 also supports other bases, example for base64:
```javascript
uuidBase62.customBase = new uuidBase62.b62("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_");
uuidBase62.customBase = new uuidBase62.baseX("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_");
var uuid = uuidBase62.v4();
// -> 31LoSI_BVeQpXtwu_-GEbL
```

For more examples check the [tests](https://github.com/dmarcelino/uuid-base62/blob/master/test/uuid-base62.test.js).

## License
MIT

0 comments on commit eec89b2

Please sign in to comment.