How to use the ramp-utils.ramp_utils.string_encoding.encode_string function in ramp-utils

To help you get started, we’ve selected a few ramp-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paris-saclay-cds / ramp-board / ramp-utils / ramp_utils / password.py View on Github external
def check_password(password, hashed_password):
    """Check if a password is the same than the hashed password.

    Parameters
    ----------
    password : str or bytes
        Human readable password.
    hashed_password : str or bytes
        The hashed password.

    Returns
    -------
    is_same_password : bool
        Return True if the two passwords are identical.
    """
    return bcrypt.checkpw(encode_string(password),
                          encode_string(hashed_password))
github paris-saclay-cds / ramp-board / ramp-utils / ramp_utils / password.py View on Github external
def hash_password(password):
    """Hash a password.

    Parameters
    ----------
    password : str or bytes
        Human readable password.

    Returns
    -------
    hashed_password : bytes
        The hashed password.
    """
    return bcrypt.hashpw(encode_string(password), bcrypt.gensalt())
github paris-saclay-cds / ramp-board / ramp-utils / ramp_utils / password.py View on Github external
"""Check if a password is the same than the hashed password.

    Parameters
    ----------
    password : str or bytes
        Human readable password.
    hashed_password : str or bytes
        The hashed password.

    Returns
    -------
    is_same_password : bool
        Return True if the two passwords are identical.
    """
    return bcrypt.checkpw(encode_string(password),
                          encode_string(hashed_password))

ramp-utils

Utilities shared across the RAMP bundle

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis

Similar packages