Skip to content

Commit cbda0a6

Browse files
committed
use xxh3 in cubestore-driver package
1 parent 2f92ff4 commit cbda0a6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/cubejs-cubestore-driver/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@cubejs-backend/cubestore": "1.2.27",
3131
"@cubejs-backend/native": "1.2.27",
3232
"@cubejs-backend/shared": "1.2.27",
33+
"@node-rs/xxhash": "^1.7.6",
3334
"csv-write-stream": "^2.0.0",
3435
"flatbuffers": "23.3.3",
3536
"fs-extra": "^9.1.0",

packages/cubejs-cubestore-driver/src/CubeStoreQueueDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import crypto from 'crypto';
1+
import { xxh3 } from '@node-rs/xxhash';
22
import {
33
QueueDriverInterface,
44
QueueDriverConnectionInterface,
@@ -22,7 +22,7 @@ import { CubeStoreDriver } from './CubeStoreDriver';
2222

2323
function hashQueryKey(queryKey: QueryKey, processUid?: string): QueryKeyHash {
2424
processUid = processUid || getProcessUid();
25-
const hash = crypto.createHash('md5').update(JSON.stringify(queryKey)).digest('hex');
25+
const hash = xxh3.xxh128(JSON.stringify(queryKey)).toString(16);
2626

2727
if (typeof queryKey === 'object' && queryKey.persistent) {
2828
return `${hash}@${processUid}` as any;

0 commit comments

Comments
 (0)