2024-08-23 14:13:13 +03:00

13 lines
203 B
JavaScript

'use strict';
const crypto = require('crypto');
let id = null;
module.exports.genId = () => {
if (!id) {
id = crypto.randomBytes(20);
Buffer.from('-AT0001-').copy(id, 0);
}
return id;
};