UNPKG

tsbase

Version:

Base class libraries for TypeScript

21 lines 693 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Guid = void 0; var Guid = /** @class */ (function () { function Guid() { } /** * Returns a new globally unique identifier (GUID) */ Guid.NewGuid = function () { return (this.S4() + this.S4() + '-' + this.S4() + '-4' + this.S4().substr(0, 3) + '-' + this.S4() + '-' + this.S4() + this.S4() + this.S4()).toLowerCase(); }; Guid.S4 = function () { // eslint-disable-next-line no-bitwise return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return Guid; }()); exports.Guid = Guid; //# sourceMappingURL=Guid.js.map