decode static method

String decode(
  1. String npub
)

Implementation

static String decode(String npub) {
  try {
    var decoder = Bech32Decoder();
    var bech32Result = decoder.convert(npub);
    var data = convertBits(bech32Result.data, 5, 8, false);
    return HEX.encode(data);
  } catch (e) {
    Logger.log.e("Nip19 decode error ${e.toString()}");
    return "";
  }
}