# Path: paramiko/util.py
# def safe_string(s):
#     out = b""
#     for c in s:
#         i = byte_ord(c)
#         if 32 <= i <= 127:
#             out += byte_chr(i)
#         else:
#             out += b("%{:02X}".format(i))
#     return out
# 
# Path: paramiko/py3compat.py
# def byte_ord(c):
#     # In case we're handed a string instead of an int.
#     if not isinstance(c, int):
#         c = ord(c)
#     return c


from binascii import hexlify
from hashlib import sha1
from paramiko.util import safe_string
from paramiko.py3compat import byte_ord
import errno
import os
import unittest
import paramiko
import paramiko.util
            "Message",
            "MissingHostKeyPolicy",
            "PasswordRequiredException",
            "RSAKey",
            "RejectPolicy",
            "SFTP",
            "SFTPAttributes",
            "SFTPClient",
            "SFTPError",
            "SFTPFile",
            "SFTPHandle",
            "SFTPServer",
            "SFTPServerInterface",
            "SSHClient",
            "SSHConfig",
            "SSHConfigDict",
            "SSHException",
            "SecurityOptions",
            "ServerInterface",
            "SubsystemHandler",
            "Transport",
            "WarningPolicy",
            "util",
        ):
            assert name in paramiko.__all__

    def test_generate_key_bytes(self):
        x = paramiko.util.generate_key_bytes(
            sha1, b"ABCDEFGH", "This is my secret passphrase.", 64
        )

# Path: paramiko/util.py
# def safe_string(s):
#     out = b""
#     for c in s:
#         i = byte_ord(c)
#         if 32 <= i <= 127:
#             out += byte_chr(i)
#         else:
#             out += b("%{:02X}".format(i))
#     return out
# 
# Path: paramiko/py3compat.py
# def byte_ord(c):
#     # In case we're handed a string instead of an int.
#     if not isinstance(c, int):
#         c = ord(c)
#     return c


# Path: tests/test_util.py
from binascii import hexlify
from hashlib import sha1
from paramiko.util import safe_string
from paramiko.py3compat import byte_ord
import errno
import os
import unittest
import paramiko
import paramiko.util

            "Message",
            "MissingHostKeyPolicy",
            "PasswordRequiredException",
            "RSAKey",
            "RejectPolicy",
            "SFTP",
            "SFTPAttributes",
            "SFTPClient",
            "SFTPError",
            "SFTPFile",
            "SFTPHandle",
            "SFTPServer",
            "SFTPServerInterface",
            "SSHClient",
            "SSHConfig",
            "SSHConfigDict",
            "SSHException",
            "SecurityOptions",
            "ServerInterface",
            "SubsystemHandler",
            "Transport",
            "WarningPolicy",
            "util",
        ):
            assert name in paramiko.__all__

    def test_generate_key_bytes(self):
        x = paramiko.util.generate_key_bytes(
            sha1, b"ABCDEFGH", "This is my secret passphrase.", 64
        )

        hex = "".join(["%02x" % byte_ord(c) for c in x])