import hashlib


def get_hash160(public_key_bytes: bytes) -> bytes:
    """Calculate hash160 of the input. First sha256 followed by a RIPEMD-160."""
    key_hash = hashlib.sha256(public_key_bytes)
    h = hashlib.new('ripemd160')
    h.update(key_hash.digest())
    return h.digest()