def METHOD_NAME(identifier: str) -> CardstackIdentifier:
    cutoff = len(identifier) - HASH_LENGTH
    data = identifier[:cutoff]
    checksum = identifier[cutoff : len(identifier)]
    if checksum != hash_func(data):
        raise Exception("Invalid DID identifier: checksum failed")
    version = data[0]
    type = short_type_to_did_type(data[1])
    unique_id = data[2:]
    return CardstackIdentifier(version, type, unique_id)