mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Tidied up Streebog operation, splitting out GOST hash into a separate op.
This commit is contained in:
parent
666c447e36
commit
99f4091c1a
11 changed files with 33 additions and 77 deletions
|
@ -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 = [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue