Inline ASCII alphabet creation
This commit is contained in:
parent
53501eeef1
commit
c1d5772383
12
index.html
12
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 => {
|
||||
|
|
Loading…
Reference in New Issue