Stole get_hexdigest, make_password and check_password methods from <https://github.com/coleifer/flask-peewee/blob/master/flask_peewee/utils.py>