From c1d5772383643962113b3fd358802c1519c1fab0 Mon Sep 17 00:00:00 2001 From: "Felix W. Dekker" Date: Mon, 8 Jul 2019 18:31:26 +0200 Subject: [PATCH] Inline ASCII alphabet creation --- index.html | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/index.html b/index.html index ca056b9..9478307 100644 --- a/index.html +++ b/index.html @@ -81,16 +81,6 @@ } } - class AsciiNumeralSystem extends NumeralSystem { - constructor() { - let alphabet = ""; - for (let i = 0; i < 256; i++) - alphabet += String.fromCharCode(i); - - super(256, alphabet); - } - } - class NumeralSystemInput { constructor(name, numeralSystem) { this.name = name; @@ -130,7 +120,7 @@ new NumeralSystemInput("Decimal", new NumeralSystem(10, "0123456789")), new NumeralSystemInput("Hexadecimal", new NumeralSystem(16, "0123456789abcdef")), new NumeralSystemInput("Base64", new NumeralSystem(64, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")), - new NumeralSystemInput("ASCII", new AsciiNumeralSystem()), + new NumeralSystemInput("ASCII", new NumeralSystem(256, new Array(256).fill(0).map((_, it) => String.fromCharCode(it)).join(""))), ]; const updateAllInputs = newValue => {