From cc4cc38fe7a451fb7c44b1617309ec891577d19b Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Mon, 9 Apr 2018 14:57:19 +0200 Subject: [PATCH] Add util.print_debug_hexarray_dump --- src/util.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util.js b/src/util.js index ca062489..af8a93cd 100644 --- a/src/util.js +++ b/src/util.js @@ -362,6 +362,20 @@ export default { } }, + /** + * Helper function to print a debug message. Debug + * messages are only printed if + * @link module:config/config.debug is set to true. + * Different than print_debug because will call Uint8Array_to_hex iff necessary. + * @param {String} str String of the debug message + */ + print_debug_hexarray_dump: function (str, arrToHex) { + if (config.debug) { + str += ': ' + util.Uint8Array_to_hex(arrToHex); + console.log(str); + } + }, + /** * Helper function to print a debug message. Debug * messages are only printed if