2020-07-25 02:02:37 +02:00
|
|
|
import { v1 as uuidV1 } from 'uuid';
|
2019-07-30 23:58:58 +02:00
|
|
|
|
|
|
|
const R = 0x52;
|
|
|
|
const e = 0x65;
|
|
|
|
const n = 0x6e;
|
|
|
|
const a = 0x61;
|
|
|
|
const i = 0x69;
|
|
|
|
const nice = 0x45;
|
|
|
|
|
2019-10-12 21:04:34 +02:00
|
|
|
/**
|
|
|
|
* This UUID is dependant on 100-nanosecond intervals since 15 October 1582.
|
|
|
|
* It wraps in 3400 AD.
|
|
|
|
* see RFC 4122 4.2.1.
|
|
|
|
*/
|
2019-07-30 23:58:58 +02:00
|
|
|
export function uuid(): string {
|
2020-07-25 02:02:37 +02:00
|
|
|
return uuidV1({
|
2019-07-30 23:58:58 +02:00
|
|
|
node: [R, e, n, a, i, nice],
|
|
|
|
});
|
|
|
|
}
|