parse static method

HashPrefix parse(
  1. String hex
)

Implementation

static HashPrefix parse(String hex) {
  if (hex.length > kHashHexLength) {
    throw Exception('Invalid length');
  }
  if (!utils.isHex(hex)) {
    throw Exception('Invalid hex');
  }

  final bytes = utils.hexToBytes(hex);
  return HashPrefix(bytes);
}