diff --git a/src/data/codingcontracttypes.ts b/src/data/codingcontracttypes.ts index e58f964bf..17a1e4662 100644 --- a/src/data/codingcontracttypes.ts +++ b/src/data/codingcontracttypes.ts @@ -1291,8 +1291,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ "Note 2: Index 0 is an 'overall' parity bit. Watch the Hamming code video from 3Blue1Brown for more information\n", "Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\n", "Note: The endianness of the encoded decimal value is reversed in relation to the endianness of the Hamming code. Where", - "the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian", - "(MSB at index 0).\n", + "the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian", + "(MSB at index 0).\n", "Extra note for automation: return the decimal value as a string", ].join(" "); }, diff --git a/src/utils/HammingCodeTools.ts b/src/utils/HammingCodeTools.ts index 11ccc31ed..c75248580 100644 --- a/src/utils/HammingCodeTools.ts +++ b/src/utils/HammingCodeTools.ts @@ -60,7 +60,7 @@ export function HammingEncodeProperly(data: number): string { let m = 1; - while (((2**((2**m) - m - 1)) - 1) < data) { + while (2 ** (2 ** m - m - 1) - 1 < data) { m++; }