diff --git a/src/base32.ts b/src/base32.ts index 7a50d45..8cc7afb 100644 --- a/src/base32.ts +++ b/src/base32.ts @@ -30,14 +30,7 @@ export const crockfordEncode = (input: Buffer): string => { }; export const crockfordDecode = (input: string): Buffer => { - // 1. Translate input to all uppercase - // 2. Translate I, L, and O to valid base 32 characters - // 3. Remove all hyphens - let sanitizedInput = input - .toUpperCase() - .replace(/O/g, "0") - .replace(/[IL]/g, "1") - .replace(/-+/g, ""); + let sanitizedInput = input.toUpperCase(); // Work from the end sanitizedInput = sanitizedInput.split("").reverse().join("");