def METHOD_NAME(oldStateData, hashName):
    """
    Unserializes a hash object from a binary string created by the
    serialize() method in this module.
    :param oldStateData: The serialized state.
    :type oldStateData: binary string
    :param hashName: The name of the hash algorithm type.
    :type hashName: str
    :returns: A hash object in the same state as the one that serialize()
              was called on.
    """
    hashInfo = _HASH_INFOS[hashName]
    assert len(oldStateData) == hashInfo.stateSize
    hashObject = hashInfo.type()
    stateDataPointer = _getHashStateDataPointer(hashObject)
    for i, byte in enumerate(oldStateData):
        stateDataPointer[i] = byte
    return hashObject