@cardanowall/poe-standard 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.
@@ -3578,13 +3578,13 @@ function readVarint(bytes, start) {
3578
3578
  function decodeMultibase(prefix, body) {
3579
3579
  switch (prefix) {
3580
3580
  case "b":
3581
- return decodeBase32(body.toLowerCase(), "rfc4648-lower");
3581
+ return decodeBase32(body, "rfc4648-lower");
3582
3582
  case "B":
3583
- return decodeBase32(body.toUpperCase(), "rfc4648-upper");
3583
+ return decodeBase32(body, "rfc4648-upper");
3584
3584
  case "f":
3585
- return decodeBase16(body.toLowerCase());
3585
+ return decodeBase16(body, "lower");
3586
3586
  case "F":
3587
- return decodeBase16(body.toUpperCase());
3587
+ return decodeBase16(body, "upper");
3588
3588
  case "z":
3589
3589
  return decodeBase58btc(body);
3590
3590
  default:
@@ -3593,10 +3593,10 @@ function decodeMultibase(prefix, body) {
3593
3593
  }
3594
3594
  var BASE16_LOWER = "0123456789abcdef";
3595
3595
  var BASE16_UPPER = "0123456789ABCDEF";
3596
- function decodeBase16(s3) {
3596
+ function decodeBase16(s3, variant) {
3597
3597
  if (s3.length % 2 !== 0) throw new Error("base16: odd-length");
3598
+ const alphabet = variant === "lower" ? BASE16_LOWER : BASE16_UPPER;
3598
3599
  const out = new Uint8Array(s3.length / 2);
3599
- const alphabet = s3 === s3.toLowerCase() ? BASE16_LOWER : BASE16_UPPER;
3600
3600
  for (let i = 0; i < out.length; i++) {
3601
3601
  const hi = alphabet.indexOf(s3[i * 2]);
3602
3602
  const lo = alphabet.indexOf(s3[i * 2 + 1]);