@cardanowall/sdk-ts 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4662,13 +4662,13 @@ function readVarint(bytes, start) {
4662
4662
  function decodeMultibase(prefix, body) {
4663
4663
  switch (prefix) {
4664
4664
  case "b":
4665
- return decodeBase32(body.toLowerCase(), "rfc4648-lower");
4665
+ return decodeBase32(body, "rfc4648-lower");
4666
4666
  case "B":
4667
- return decodeBase32(body.toUpperCase(), "rfc4648-upper");
4667
+ return decodeBase32(body, "rfc4648-upper");
4668
4668
  case "f":
4669
- return decodeBase16(body.toLowerCase());
4669
+ return decodeBase16(body, "lower");
4670
4670
  case "F":
4671
- return decodeBase16(body.toUpperCase());
4671
+ return decodeBase16(body, "upper");
4672
4672
  case "z":
4673
4673
  return decodeBase58btc(body);
4674
4674
  default:
@@ -4677,10 +4677,10 @@ function decodeMultibase(prefix, body) {
4677
4677
  }
4678
4678
  var BASE16_LOWER = "0123456789abcdef";
4679
4679
  var BASE16_UPPER = "0123456789ABCDEF";
4680
- function decodeBase16(s) {
4680
+ function decodeBase16(s, variant) {
4681
4681
  if (s.length % 2 !== 0) throw new Error("base16: odd-length");
4682
+ const alphabet = variant === "lower" ? BASE16_LOWER : BASE16_UPPER;
4682
4683
  const out = new Uint8Array(s.length / 2);
4683
- const alphabet = s === s.toLowerCase() ? BASE16_LOWER : BASE16_UPPER;
4684
4684
  for (let i = 0; i < out.length; i++) {
4685
4685
  const hi = alphabet.indexOf(s[i * 2]);
4686
4686
  const lo = alphabet.indexOf(s[i * 2 + 1]);