Internal Authentication Password Encoding

Working Python function for others that achieves the same thing

import random
import hashlib

def sha256PasswordSalt(password):
    rand = random.Random()
    salt = "{:08X}".format(rand.randint(0, 0xFFFFFFFF))
    hashedPass = hashlib.sha256((password + salt).encode('utf-8')).hexdigest()
    return "[{}]{}".format(salt, hashedPass)