def METHOD_NAME(msg: bytes, consensusBranchId: int) -> bytes:
    digest = blake2b(
        digest_size=32,
        person=b'ZcashHistory' + struct.pack("<I", consensusBranchId))
    digest.update(msg)
    return digest.digest()