def METHOD_NAME(data, checksum=None):
    """Returns decoded data, verifies hash digest if provided"""
    cbor = bc32decode(data)
    if checksum is not None:
        h = bc32decode(checksum)
        assert h == hashlib.sha256(cbor).digest()
    return cbor_decode(cbor)