diff --git a/package.json b/package.json index 13c1986a7400893dada19ac1ee171ecf44b5662d..3cddf1c3ca46902673bebe29902ad2cb58bd8ae6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "main": "build/index.js", "types": "build/index.d.ts", "module": "build/index.js", - "dependencies": {}, + "dependencies": { + "buffer": "^5.2.1" + }, "devDependencies": { "@types/jasmine": "2.8.8", "@types/node": "10.5.2", diff --git a/src/jalhyd_object.ts b/src/jalhyd_object.ts index 33493deb62ec978c5dc00a05a9fb57427742acad..708f8fd8fdf15f0881c34019733c95b6fb10b5be 100644 --- a/src/jalhyd_object.ts +++ b/src/jalhyd_object.ts @@ -13,7 +13,7 @@ export abstract class JalhydObject implements IJalhydObject { } public static get nextUID(): string { - return Math.random().toString(36).substring(2, 8); + return Buffer.from(Math.random().toString(36).substring(2)).toString("base64").substring(0, 6); } /** id numérique unique */