From a3024011a91d3941f81481dd4d600e9684eb0fd4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 2 Feb 2012 00:11:51 -0800 Subject: upgrading to Montage v0.6 Signed-off-by: Valerio Virgillito --- node_modules/montage/core/uuid.js | 96 +++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'node_modules/montage/core/uuid.js') 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 @@ @class module:montage/core/uuid.Uuid @extends module:montage/core/core.Montage */ -var Montage = require("montage").Montage, - CHARS = '0123456789ABCDEF'.split(''), +var CHARS = '0123456789ABCDEF'.split(''), FORMAT = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.split(''), - - Uuid = exports.Uuid = Montage.create(Montage,/** @lends module:montage/core/uuid.Uuid# */ { - -/** - Returns a univerally unique ID (UUID). - @function - @param {Property} argument - @returns {String} The UUID. - */ + Uuid = exports.Uuid = Object.create(Object.prototype, /** @lends module:montage/core/uuid.Uuid# */ { + /** + Returns a univerally unique ID (UUID). + @function + @param {Property} argument + @returns {String} The UUID. + */ generate: { enumerable: false, - value: function generate(argument) { - var c = CHARS, id = FORMAT, r; + value: generate + } + }); - id[0] = c[(r = Math.random() * 0x100000000) & 0xf]; - id[1] = c[(r >>>= 4) & 0xf]; - id[2] = c[(r >>>= 4) & 0xf]; - id[3] = c[(r >>>= 4) & 0xf]; - id[4] = c[(r >>>= 4) & 0xf]; - id[5] = c[(r >>>= 4) & 0xf]; - id[6] = c[(r >>>= 4) & 0xf]; - id[7] = c[(r >>>= 4) & 0xf]; +exports.generate = generate; +function generate(argument) { + var c = CHARS, id = FORMAT, r; - id[9] = c[(r = Math.random() * 0x100000000) & 0xf]; - id[10] = c[(r >>>= 4) & 0xf]; - id[11] = c[(r >>>= 4) & 0xf]; - id[12] = c[(r >>>= 4) & 0xf]; - id[15] = c[(r >>>= 4) & 0xf]; - id[16] = c[(r >>>= 4) & 0xf]; - id[17] = c[(r >>>= 4) & 0xf]; + id[0] = c[(r = Math.random() * 0x100000000) & 0xf]; + id[1] = c[(r >>>= 4) & 0xf]; + id[2] = c[(r >>>= 4) & 0xf]; + id[3] = c[(r >>>= 4) & 0xf]; + id[4] = c[(r >>>= 4) & 0xf]; + id[5] = c[(r >>>= 4) & 0xf]; + id[6] = c[(r >>>= 4) & 0xf]; + id[7] = c[(r >>>= 4) & 0xf]; - id[19] = c[(r = Math.random() * 0x100000000) & 0x3 | 0x8]; - id[20] = c[(r >>>= 4) & 0xf]; - id[21] = c[(r >>>= 4) & 0xf]; - id[22] = c[(r >>>= 4) & 0xf]; - id[24] = c[(r >>>= 4) & 0xf]; - id[25] = c[(r >>>= 4) & 0xf]; - id[26] = c[(r >>>= 4) & 0xf]; - id[27] = c[(r >>>= 4) & 0xf]; + id[9] = c[(r = Math.random() * 0x100000000) & 0xf]; + id[10] = c[(r >>>= 4) & 0xf]; + id[11] = c[(r >>>= 4) & 0xf]; + id[12] = c[(r >>>= 4) & 0xf]; + id[15] = c[(r >>>= 4) & 0xf]; + id[16] = c[(r >>>= 4) & 0xf]; + id[17] = c[(r >>>= 4) & 0xf]; - id[28] = c[(r = Math.random() * 0x100000000) & 0xf]; - id[29] = c[(r >>>= 4) & 0xf]; - id[30] = c[(r >>>= 4) & 0xf]; - id[31] = c[(r >>>= 4) & 0xf]; - id[32] = c[(r >>>= 4) & 0xf]; - id[33] = c[(r >>>= 4) & 0xf]; - id[34] = c[(r >>>= 4) & 0xf]; - id[35] = c[(r >>>= 4) & 0xf]; + id[19] = c[(r = Math.random() * 0x100000000) & 0x3 | 0x8]; + id[20] = c[(r >>>= 4) & 0xf]; + id[21] = c[(r >>>= 4) & 0xf]; + id[22] = c[(r >>>= 4) & 0xf]; + id[24] = c[(r >>>= 4) & 0xf]; + id[25] = c[(r >>>= 4) & 0xf]; + id[26] = c[(r >>>= 4) & 0xf]; + id[27] = c[(r >>>= 4) & 0xf]; - return id.join(''); - } - } - }); + id[28] = c[(r = Math.random() * 0x100000000) & 0xf]; + id[29] = c[(r >>>= 4) & 0xf]; + id[30] = c[(r >>>= 4) & 0xf]; + id[31] = c[(r >>>= 4) & 0xf]; + id[32] = c[(r >>>= 4) & 0xf]; + id[33] = c[(r >>>= 4) & 0xf]; + id[34] = c[(r >>>= 4) & 0xf]; + id[35] = c[(r >>>= 4) & 0xf]; + + return id.join(''); +} -- cgit v1.2.3