Use locale independent sorting

This commit is contained in:
Simon Warta 2021-03-23 13:25:01 +01:00
parent 5fe0f5582e
commit e0716fac21

View File

@ -12,7 +12,9 @@ import { MultisigThresholdPubkey, SinglePubkey } from "./pubkeys";
* Returns 0 if `a === b`.
*/
export function compareArrays(a: Uint8Array, b: Uint8Array): number {
return toHex(a).localeCompare(toHex(b));
const aHex = toHex(a);
const bHex = toHex(b);
return aHex === bHex ? 0 : aHex < bHex ? -1 : 1;
}
export function createMultisigThresholdPubkey(