@savantly/gremlin-js
Version:
Gremlin client [Tinkerpop]
17 lines (14 loc) • 376 B
text/typescript
export class Guid {
private static s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
private static guid() {
return this.s4() + this.s4() + '-' + this.s4() + '-' + this.s4() + '-' +
this.s4() + '-' + this.s4() + this.s4() + this.s4();
}
static random() {
return Guid.guid();
}
}