File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
packages/cubejs-backend-shared Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 3535 "typescript" : " ~5.2.2"
3636 },
3737 "dependencies" : {
38+ "@node-rs/xxhash" : " ^1.7.6" ,
3839 "@oclif/color" : " ^0.1.2" ,
3940 "bytes" : " ^3.1.2" ,
4041 "cli-progress" : " ^3.9.0" ,
Original file line number Diff line number Diff line change 11/* eslint-disable arrow-body-style,no-restricted-syntax */
2- import crypto from 'crypto' ;
3-
2+ import { xxh3 } from '@node-rs/xxhash' ;
43import { Optional } from './type-helpers' ;
54
65export type PromiseLock = {
@@ -273,9 +272,7 @@ export const asyncDebounce = <Ret, Arguments>(
273272 const cache = new Map < string , Promise < Ret > > ( ) ;
274273
275274 return async ( ...args : Arguments [ ] ) => {
276- const key = crypto . createHash ( 'md5' )
277- . update ( args . map ( ( v ) => JSON . stringify ( v ) ) . join ( ',' ) )
278- . digest ( 'hex' ) ;
275+ const key = xxh3 . xxh64 ( args . map ( ( v ) => JSON . stringify ( v ) ) . join ( ',' ) ) . toString ( 16 ) ;
279276
280277 if ( cache . has ( key ) ) {
281278 return < Promise < Ret > > cache . get ( key ) ;
You can’t perform that action at this time.
0 commit comments