validateAndHashKey method

BuBytes validateAndHashKey(
  1. List<int> pubKey, {
  2. CryptoKeyEncoding pubKeyMode = CryptoKeyEncoding.base,
})

Validates the pubkey and returns its hash160.

Implementation

BuBytes validateAndHashKey(
  List<int> pubKey, {
  CryptoKeyEncoding pubKeyMode = CryptoKeyEncoding.base,
}) {
  final publicKey = AddrKeyValidator.validateAndGetSecp256k1Key(pubKey);
  final BuBytes pubKeyBytes = publicKey.toBytes(mode: pubKeyMode);
  return QuickCrypto.hash160(pubKeyBytes);
}