From b27e7d00fef854bdbce2670c47b85fa01423dddd Mon Sep 17 00:00:00 2001 From: s2ks Date: Fri, 8 Jul 2022 01:37:42 +0200 Subject: [PATCH] format --- src/data/codingcontracttypes.ts | 4 ++-- src/utils/HammingCodeTools.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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++; }