def sha512_digest(instr):
    if six.PY3:
        b = salt.utils.to_bytes(instr)
        return hashlib.sha512(b).hexdigest()
    return hashlib.sha512(instr).hexdigest()
Generate an sha512 hash of a given string
dataset/ETHPy150Open saltstack/salt/salt/modules/hashutil.py/sha512_digest