Add Base32 Hex Extended option.

This commit is contained in:
peterc-s 2025-02-28 16:52:15 +00:00
parent d3357d2acd
commit 3057a20791
No known key found for this signature in database
GPG key ID: 439F1C3C7D4BCBD1
5 changed files with 214 additions and 4 deletions

View file

@ -6,6 +6,8 @@
import Operation from "../Operation.mjs";
import Utils from "../Utils.mjs";
import {ALPHABET_OPTIONS} from "../lib/Base32.mjs";
/**
* From Base32 operation
@ -27,8 +29,8 @@ class FromBase32 extends Operation {
this.args = [
{
name: "Alphabet",
type: "binaryString",
value: "A-Z2-7="
type: "editableOption",
value: ALPHABET_OPTIONS
},
{
name: "Remove non-alphabet chars",
@ -41,6 +43,11 @@ class FromBase32 extends Operation {
pattern: "^(?:[A-Z2-7]{8})+(?:[A-Z2-7]{2}={6}|[A-Z2-7]{4}={4}|[A-Z2-7]{5}={3}|[A-Z2-7]{7}={1})?$",
flags: "",
args: ["A-Z2-7=", false]
},
{
pattern: "^(?:[0-9A-V]{8})+(?:[0-9A-V]{2}={6}|[0-9A-V]{4}={4}|[0-9A-V]{5}={3}|[0-9A-V]{7}={1})?$",
flags: "",
args: ["0-9A-V=", false]
}
];
}
@ -96,3 +103,4 @@ class FromBase32 extends Operation {
}
export default FromBase32;