import hashlib
import binascii


def verify_hash(hashed_id, usr_id):                
    """Verify hashed id against one provided by user"""
    #For security purposes, the original will be salted after 64 chars
    salt = hashed_id[:64]
    hashed_id = hashed_id[64:]
    pwdhash = hashlib.pbkdf2_hmac('sha512',
                                  usr_id.encode('utf-8'),
                                  salt.encode('ascii'),
                                  100000)
    pwdhash = binascii.hexlify(pwdhash).decode('ascii')
    return pwdhash == hashed_id