v1 and v4 UUID generator with prefixes
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
index.js
package.json

README.md

prefixed-uuid

prefixed-uuid is a tiny module that adds optional prefixes to UUIDs.

Installation

npm install prefixed-uuid

Usage

var uuid = require( 'prefixed-uuid' );

uuid();
// '0428ccac-e9f0-4485-85f6-382ca438136f'

uuid( 'my-prefix' );
// 'my-prefix-bfe89a5c-6766-4acf-89be-70a122012f1a'

uuid( 'my-prefix', 'v1' );
// 'my-prefix-f3cc5d20-15a5-11e2-bec9-510613aafe0d'

uuid( null, 'v1' );
// 'fd8fe7f0-15a5-11e2-bec9-510613aafe0d'