import hashlib

import users_table


def create_user(username, password):
    encoded = password.encode("utf-8")
    hashed = hashlib.sha256(encoded).hexdigest()
    users_table.add_user(username, hashed)


def login(username, password):
    encoded = password.encode("utf-8")
    hashed = hashlib.sha256(encoded).hexdigest()

    return users_table.get_user(username) and \
        hashed == users_table.get_user(username)["hashed"]

bb10eb775f1db7ea84b1bf40994de12d6df4d5f9
<mask token>

<mask token>


def login(username, password):
    encoded = password.encode('utf-8')
    hashed = hashlib.sha256(encoded).hexdigest()
    return users_table.get_user(username) and hashed == users_table.get_user(
        username)['hashed']

<mask token>


def create_user(username, password):
    encoded = password.encode('utf-8')
    hashed = hashlib.sha256(encoded).hexdigest()
    users_table.add_user(username, hashed)


def login(username, password):
    encoded = password.encode('utf-8')
    hashed = hashlib.sha256(encoded).hexdigest()
    return users_table.get_user(username) and hashed == users_table.get_user(
        username)['hashed']

import hashlib
import users_table


def create_user(username, password):
    encoded = password.encode('utf-8')
    hashed = hashlib.sha256(encoded).hexdigest()
    users_table.add_user(username, hashed)


def login(username, password):
    encoded = password.encode('utf-8')
    hashed = hashlib.sha256(encoded).hexdigest()
    return users_table.get_user(username) and hashed == users_table.get_user(
        username)['hashed']

import hashlib

import users_table


def create_user(username, password):
    encoded = password.encode("utf-8")
    hashed = hashlib.sha256(encoded).hexdigest()
    users_table.add_user(username, hashed)


def login(username, password):
    encoded = password.encode("utf-8")
    hashed = hashlib.sha256(encoded).hexdigest()

    return users_table.get_user(username) and \
        hashed == users_table.get_user(username)["hashed"]
