UNPKG

501 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function getMongoObjectId() {
4 // tslint:disable-next-line:no-bitwise
5 const timestamp = (new Date().getTime() / 1000 | 0).toString(16);
6 return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function () {
7 // tslint:disable-next-line:no-bitwise
8 return (Math.random() * 16 | 0).toString(16);
9 }).toLowerCase();
10}
11exports.getMongoObjectId = getMongoObjectId;
12//# sourceMappingURL=idGenerator.js.map
\No newline at end of file