def create_salt()

in fxa/crypto.py [0:0]


def create_salt(version, value):
    """Creates a formatted salt for salting the password stretch. This is flexible and
    allows providing a core value (the distinct part of the salt) or an entire salt
    that includes the version namespace."""
    if isinstance(value, bytes):
        value = value.decode('utf8')

    if version == 2:
        value = value.replace(SALT_NAMESPACE_V2, "")
        salt = hkdf_namespace(KEY_STRETCH_NAMESPACE_V2, value)
        return salt.decode('utf8')
    else:
        value = value.replace(SALT_NAMESPACE_V1, "")
        salt = hkdf_namespace(KEY_STRETCH_NAMESPACE_V1, value)
        return salt.decode('utf8')