Skip to content

Commit de9f653

Browse files
committed
use spark for md5 instead of non-exported member from common
1 parent 50e66aa commit de9f653

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"webpack-cli": "^6.0.1"
6161
},
6262
"dependencies": {
63-
"@eppo/js-client-sdk-common": "4.8.4"
63+
"@eppo/js-client-sdk-common": "4.8.4",
64+
"spark-md5": "^3.0.2"
6465
},
6566
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
6667
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
IBanditLogger,
2424
IObfuscatedPrecomputedConfigurationResponse,
2525
} from '@eppo/js-client-sdk-common';
26-
import { getMD5Hash } from '@eppo/js-client-sdk-common/dist/obfuscation';
26+
import SparkMD5 from 'spark-md5';
2727

2828
import { assignmentCacheFactory } from './cache/assignment-cache-factory';
2929
import HybridAssignmentCache from './cache/hybrid-assignment-cache';
@@ -365,7 +365,7 @@ export class EppoJSClient extends EppoClient {
365365
*/
366366
export function buildStorageKeySuffix(apiKey: string): string {
367367
// Note that we use the last 8 characters of hashed API key to create per-API key persistent storages and caches
368-
return getMD5Hash(apiKey).slice(-8);
368+
return new SparkMD5().append(apiKey).end().slice(-8);
369369
}
370370

371371
/**

0 commit comments

Comments
 (0)