owobot/util/uuidtoint.js
7cc5c4f330d47060 de78065438 Initial commit
2024-07-06 11:02:11 -04:00

5 lines
274 B
JavaScript

module.exports = function (uuid) {
const split_uuid = uuid.replace(/[^0-9a-f]/g, '').replace(/.{1,8}/g, a => { return '0x' + a }).match(/.{1,10}/g)
const num_uuid = [+split_uuid[0] << 0, +split_uuid[1] << 0, +split_uuid[2] << 0, +split_uuid[3] << 0]
return num_uuid
}