mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Tidied up Streebog operation, splitting out GOST hash into a separate op.
This commit is contained in:
@@ -12,7 +12,7 @@ import Utils from "../Utils";
|
||||
/**
|
||||
* Convert a byte array into a hex string.
|
||||
*
|
||||
* @param {Uint8Array|byteArray} data
|
||||
* @param {byteArray|Uint8Array|ArrayBuffer} data
|
||||
* @param {string} [delim=" "]
|
||||
* @param {number} [padding=2]
|
||||
* @returns {string}
|
||||
@@ -26,6 +26,7 @@ import Utils from "../Utils";
|
||||
*/
|
||||
export function toHex(data, delim=" ", padding=2) {
|
||||
if (!data) return "";
|
||||
if (data instanceof ArrayBuffer) data = new Uint8Array(data);
|
||||
|
||||
let output = "";
|
||||
|
||||
@@ -47,7 +48,7 @@ export function toHex(data, delim=" ", padding=2) {
|
||||
/**
|
||||
* Convert a byte array into a hex string as efficiently as possible with no options.
|
||||
*
|
||||
* @param {byteArray} data
|
||||
* @param {byteArray|Uint8Array|ArrayBuffer} data
|
||||
* @returns {string}
|
||||
*
|
||||
* @example
|
||||
@@ -56,6 +57,7 @@ export function toHex(data, delim=" ", padding=2) {
|
||||
*/
|
||||
export function toHexFast(data) {
|
||||
if (!data) return "";
|
||||
if (data instanceof ArrayBuffer) data = new Uint8Array(data);
|
||||
|
||||
const output = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user