diff --git a/src/lib/serial/chord.ts b/src/lib/serial/chord.ts index 4d52aad1..532e2ca3 100644 --- a/src/lib/serial/chord.ts +++ b/src/lib/serial/chord.ts @@ -69,5 +69,8 @@ export function hashChord(actions: number[]) { for (let i = 0; i < 16; i++) { hash = Math.imul(hash ^ view.getUint8(i), 16777619); } + if ((hash & 0xff) === 0xff) { + hash ^= 0xff; + } return hash & 0x3fff_ffff; } diff --git a/src/routes/(app)/config/chords/will-my-compound-break/+page.svelte b/src/routes/(app)/config/chords/will-my-compound-break/+page.svelte new file mode 100644 index 00000000..a7e5b4a7 --- /dev/null +++ b/src/routes/(app)/config/chords/will-my-compound-break/+page.svelte @@ -0,0 +1,66 @@ + + +
+ Pre-2.2.0 there was a bug where creating a compound with specific chords as a + base could corrupt your library. +
+ +{#if broken.length > 0} +Chords have been detected.
++ If you have ever tried to create a compound chord with any of these as a base, your library might have been corrupted. +
+ {#each broken as chord} +No problematic chords found
+{/if} + +