diff options
author | Valerio Virgillito | 2012-02-02 00:11:51 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-02 00:11:51 -0800 |
commit | 5a305ec44b2bd5198a248357439aae8ebbd75fee (patch) | |
tree | ec3b756beab7105841353ef79d4e8059b2b6a91c /node_modules/montage/core/uuid.js | |
parent | dbe9c7705860fb3551321e23e7eab763f622241c (diff) | |
download | ninja-5a305ec44b2bd5198a248357439aae8ebbd75fee.tar.gz |
upgrading to Montage v0.6
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/core/uuid.js')
-rwxr-xr-x | node_modules/montage/core/uuid.js | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/node_modules/montage/core/uuid.js b/node_modules/montage/core/uuid.js index d2642107..09d9acec 100755 --- a/node_modules/montage/core/uuid.js +++ b/node_modules/montage/core/uuid.js | |||
@@ -16,59 +16,59 @@ | |||
16 | @class module:montage/core/uuid.Uuid | 16 | @class module:montage/core/uuid.Uuid |
17 | @extends module:montage/core/core.Montage | 17 | @extends module:montage/core/core.Montage |
18 | */ | 18 | */ |
19 | var Montage = require("montage").Montage, | 19 | var CHARS = '0123456789ABCDEF'.split(''), |
20 | CHARS = '0123456789ABCDEF'.split(''), | ||
21 | FORMAT = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.split(''), | 20 | FORMAT = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.split(''), |
22 | 21 | Uuid = exports.Uuid = Object.create(Object.prototype, /** @lends module:montage/core/uuid.Uuid# */ { | |
23 | Uuid = exports.Uuid = Montage.create(Montage,/** @lends module:montage/core/uuid.Uuid# */ { | 22 | /** |
24 | 23 | Returns a univerally unique ID (UUID). | |
25 | /** | 24 | @function |
26 | Returns a univerally unique ID (UUID). | 25 | @param {Property} argument |
27 | @function | 26 | @returns {String} The UUID. |
28 | @param {Property} argument | 27 | */ |
29 | @returns {String} The UUID. | ||
30 | */ | ||
31 | generate: { | 28 | generate: { |
32 | enumerable: false, | 29 | enumerable: false, |
33 | value: function generate(argument) { | 30 | value: generate |
34 | var c = CHARS, id = FORMAT, r; | 31 | } |
32 | }); | ||
35 | 33 | ||
36 | id[0] = c[(r = Math.random() * 0x100000000) & 0xf]; | 34 | exports.generate = generate; |
37 | id[1] = c[(r >>>= 4) & 0xf]; | 35 | function generate(argument) { |
38 | id[2] = c[(r >>>= 4) & 0xf]; | 36 | var c = CHARS, id = FORMAT, r; |
39 | id[3] = c[(r >>>= 4) & 0xf]; | ||
40 | id[4] = c[(r >>>= 4) & 0xf]; | ||
41 | id[5] = c[(r >>>= 4) & 0xf]; | ||
42 | id[6] = c[(r >>>= 4) & 0xf]; | ||
43 | id[7] = c[(r >>>= 4) & 0xf]; | ||
44 | 37 | ||
45 | id[9] = c[(r = Math.random() * 0x100000000) & 0xf]; | 38 | id[0] = c[(r = Math.random() * 0x100000000) & 0xf]; |
46 | id[10] = c[(r >>>= 4) & 0xf]; | 39 | id[1] = c[(r >>>= 4) & 0xf]; |
47 | id[11] = c[(r >>>= 4) & 0xf]; | 40 | id[2] = c[(r >>>= 4) & 0xf]; |
48 | id[12] = c[(r >>>= 4) & 0xf]; | 41 | id[3] = c[(r >>>= 4) & 0xf]; |
49 | id[15] = c[(r >>>= 4) & 0xf]; | 42 | id[4] = c[(r >>>= 4) & 0xf]; |
50 | id[16] = c[(r >>>= 4) & 0xf]; | 43 | id[5] = c[(r >>>= 4) & 0xf]; |
51 | id[17] = c[(r >>>= 4) & 0xf]; | 44 | id[6] = c[(r >>>= 4) & 0xf]; |
45 | id[7] = c[(r >>>= 4) & 0xf]; | ||
52 | 46 | ||
53 | id[19] = c[(r = Math.random() * 0x100000000) & 0x3 | 0x8]; | 47 | id[9] = c[(r = Math.random() * 0x100000000) & 0xf]; |
54 | id[20] = c[(r >>>= 4) & 0xf]; | 48 | id[10] = c[(r >>>= 4) & 0xf]; |
55 | id[21] = c[(r >>>= 4) & 0xf]; | 49 | id[11] = c[(r >>>= 4) & 0xf]; |
56 | id[22] = c[(r >>>= 4) & 0xf]; | 50 | id[12] = c[(r >>>= 4) & 0xf]; |
57 | id[24] = c[(r >>>= 4) & 0xf]; | 51 | id[15] = c[(r >>>= 4) & 0xf]; |
58 | id[25] = c[(r >>>= 4) & 0xf]; | 52 | id[16] = c[(r >>>= 4) & 0xf]; |
59 | id[26] = c[(r >>>= 4) & 0xf]; | 53 | id[17] = c[(r >>>= 4) & 0xf]; |
60 | id[27] = c[(r >>>= 4) & 0xf]; | ||
61 | 54 | ||
62 | id[28] = c[(r = Math.random() * 0x100000000) & 0xf]; | 55 | id[19] = c[(r = Math.random() * 0x100000000) & 0x3 | 0x8]; |
63 | id[29] = c[(r >>>= 4) & 0xf]; | 56 | id[20] = c[(r >>>= 4) & 0xf]; |
64 | id[30] = c[(r >>>= 4) & 0xf]; | 57 | id[21] = c[(r >>>= 4) & 0xf]; |
65 | id[31] = c[(r >>>= 4) & 0xf]; | 58 | id[22] = c[(r >>>= 4) & 0xf]; |
66 | id[32] = c[(r >>>= 4) & 0xf]; | 59 | id[24] = c[(r >>>= 4) & 0xf]; |
67 | id[33] = c[(r >>>= 4) & 0xf]; | 60 | id[25] = c[(r >>>= 4) & 0xf]; |
68 | id[34] = c[(r >>>= 4) & 0xf]; | 61 | id[26] = c[(r >>>= 4) & 0xf]; |
69 | id[35] = c[(r >>>= 4) & 0xf]; | 62 | id[27] = c[(r >>>= 4) & 0xf]; |
70 | 63 | ||
71 | return id.join(''); | 64 | id[28] = c[(r = Math.random() * 0x100000000) & 0xf]; |
72 | } | 65 | id[29] = c[(r >>>= 4) & 0xf]; |
73 | } | 66 | id[30] = c[(r >>>= 4) & 0xf]; |
74 | }); | 67 | id[31] = c[(r >>>= 4) & 0xf]; |
68 | id[32] = c[(r >>>= 4) & 0xf]; | ||
69 | id[33] = c[(r >>>= 4) & 0xf]; | ||
70 | id[34] = c[(r >>>= 4) & 0xf]; | ||
71 | id[35] = c[(r >>>= 4) & 0xf]; | ||
72 | |||
73 | return id.join(''); | ||
74 | } | ||