diff --git a/package.json b/package.json index d9d1ea9..0446dac 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,7 @@ "bowser": "^2.11.0", "js-cookie": "^3.0.5", "lodash-es": "^4.17.21", - "md5": "^2.3.0", - "randombytes": "^2.1.0" + "md5": "^2.3.0" }, "peerDependencies": { "axios": "^1.2" @@ -89,7 +88,7 @@ "url": "https://github.com/xylabs/sdk-pixel-js.git" }, "sideEffects": false, - "version": "1.6.0", + "version": "1.7.0", "packageManager": "yarn@4.3.1", "type": "module" -} \ No newline at end of file +} diff --git a/src/UniqueUserId.ts b/src/UniqueUserId.ts index 5070f41..4ab580a 100644 --- a/src/UniqueUserId.ts +++ b/src/UniqueUserId.ts @@ -1,5 +1,3 @@ -import randomBytes from 'randombytes' - export class UniqueUserId { private static localStorageId = '_coin_cid' id: string @@ -14,6 +12,6 @@ export class UniqueUserId { } private generateId() { - return randomBytes(16).toString('base64') + return crypto.randomUUID() } } diff --git a/yarn.lock b/yarn.lock index e86e8e7..3cf8009 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2093,7 +2093,6 @@ __metadata: lodash-es: "npm:^4.17.21" md5: "npm:^2.3.0" npm-package-json-lint: "npm:^8.0.0" - randombytes: "npm:^2.1.0" reflect-metadata: "npm:^0.2.2" ts-jest: "npm:^29.2.2" ts-node: "npm:^10.9.2" @@ -10020,15 +10019,6 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.1.0": - version: 2.1.0 - resolution: "randombytes@npm:2.1.0" - dependencies: - safe-buffer: "npm:^5.1.0" - checksum: 10/4efd1ad3d88db77c2d16588dc54c2b52fd2461e70fe5724611f38d283857094fe09040fa2c9776366803c3152cf133171b452ef717592b65631ce5dc3a2bdafc - languageName: node - linkType: hard - "rc-config-loader@npm:^4.1.3": version: 4.1.3 resolution: "rc-config-loader@npm:4.1.3" @@ -11884,7 +11874,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10/32872cd0ff68a3ddade7a7617b8f4c2ae8764d8b7d884c651b74457967a9e0e886267d3ecc781220629c44a865167b61c375d2da6c720c840ecd73f45d5d9451