Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const checksumIndices = (version: string, map: KeyIndexMap): string => {
const c = new Checksum();
c.update(version);
// Visit map keys in sorted order
const keys = Object.keys(map).sort();
for (const key of keys) {
c.update(key);
// Mapped values must be visited in their existing order.
for (const val of map[key].keys) {
c.update(val);
}
}
return c.get().toString(16);
};