added delim parameter to utils.mjs

This commit is contained in:
Katie Makarska 2025-04-23 21:05:41 -04:00
parent 23bfe8740f
commit 0a4fd20518

View file

@ -339,12 +339,12 @@ class Utils {
* // returns [208, 159, 209, 128, 208, 184, 208, 178, 208, 181, 209, 130] * // returns [208, 159, 209, 128, 208, 184, 208, 178, 208, 181, 209, 130]
* Utils.convertToByteArray("0JfQtNGA0LDQstGB0YLQstGD0LnRgtC1", "base64"); * Utils.convertToByteArray("0JfQtNGA0LDQstGB0YLQstGD0LnRgtC1", "base64");
*/ */
static convertToByteArray(str, type) { static convertToByteArray(str, type, delim = "Auto") {
switch (type.toLowerCase()) { switch (type.toLowerCase()) {
case "binary": case "binary":
return fromBinary(str); return fromBinary(str);
case "hex": case "hex":
return fromHex(str); return fromHex(str, delim);
case "decimal": case "decimal":
return fromDecimal(str); return fromDecimal(str);
case "base64": case "base64":