iden
v0.1.1
Published
Unique identifier generator.
Downloads
8
Maintainers
Readme
iden
Unique identifier generator.
Installation
Node
npm install iden
Bower
bower install iden
AMD, <script>
Use dist/iden.js
or dist/iden.min.js
(minified version).
Usage ↑
ECMAScript 6
import * as iden from 'iden';
Node
var iden = require("iden");
Duo
var iden = require("gamtiq/iden");
AMD
define(["path/to/dist/iden.js"], function(iden) {
...
});
Bower, <script>
<!-- Use bower_components/iden/dist/iden.js if the library was installed by Bower -->
<script type="text/javascript" src="path/to/dist/iden.js"></script>
<script type="text/javascript">
// iden is available via iden field of window object
...
</script>
Examples ↑
iden.getUuid(); // uuid in form of xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
API ↑
getUuid([settings: Object]): String
Generate unique identifier (UUID as described in RFC 4122 version 4).
See doc
folder for details.
Inspiration ↑
- http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
- leahciMic/uuid-v4
- broofa/node-uuid
- makeable/uuid-v4.js
Contributing ↑
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
License ↑
Copyright (c) 2016 Denis Sikuler
Licensed under the MIT license.