nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / angular-uuid / uuid.js
1 /**!
2  * angular-uuid v0.1.0
3  * @copyright 2013 Arunjit Singh <opensrc@ajsd.in>. All Rights Reserved.
4  * @license MIT; see LICENCE.
5  * [https://github.com/ajsd/angular-uuid.git]
6  */
7 'use strict';
8
9 /**
10  * A UUID-4 generator.
11  */
12 angular.module('uuid', []).service('uuid4', function() {
13   /**! http://stackoverflow.com/a/2117523/377392 */
14   var fmt = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
15   this.generate = function() {
16     return fmt.replace(/[xy]/g, function(c) {
17       var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
18       return v.toString(16);
19     });
20   };
21 });