mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Added numeric validation for arguments in Binary and Hex operattions. Fixes #1178
This commit is contained in:
parent
95884d77cf
commit
1e0e7f16a7
5 changed files with 18 additions and 4 deletions
|
@ -15,7 +15,7 @@ import { toHex, fromHex } from "./Hex.mjs";
|
|||
* @param {number} indent
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatDnStr (dnStr, indent) {
|
||||
export function formatDnStr(dnStr, indent) {
|
||||
const fields = dnStr.substr(1).replace(/([^\\])\//g, "$1$1/").split(/[^\\]\//);
|
||||
let output = "",
|
||||
maxKeyLen = 0,
|
||||
|
@ -54,7 +54,7 @@ export function formatDnStr (dnStr, indent) {
|
|||
* @param {number} indent
|
||||
* @returns {string}
|
||||
*/
|
||||
export function formatByteStr (byteStr, length, indent) {
|
||||
export function formatByteStr(byteStr, length, indent) {
|
||||
byteStr = toHex(fromHex(byteStr), ":");
|
||||
length = length * 3;
|
||||
let output = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue