mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Added 'Decimal' option for toggleStrings. Closes #337.
This commit is contained in:
parent
c1b2fc9400
commit
affe057cab
10 changed files with 51 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* Byte representation functions.
|
||||
* Hexadecimal functions.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2016
|
||||
|
@ -83,8 +83,7 @@ export function toHexFast(data) {
|
|||
* // returns [10,20,30]
|
||||
* fromHex("0a:14:1e", "Colon");
|
||||
*/
|
||||
export function fromHex(data, delim, byteLen=2) {
|
||||
delim = delim || "Auto";
|
||||
export function fromHex(data, delim="Auto", byteLen=2) {
|
||||
if (delim !== "None") {
|
||||
const delimRegex = delim === "Auto" ? /[^a-f\d]/gi : Utils.regexRep(delim);
|
||||
data = data.replace(delimRegex, "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue