Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias identifier Import alias FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Assign NameStore Dict Str Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Str body Expr Str If UnaryOpNot Call SubscriptLoad NameLoad Index Str NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad With Call NameLoad NameLoad Str NameStore body Assign NameStore Call SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Return NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryExcept body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Return NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad With Call NameLoad NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return CompareEq NameLoad NameLoad decorator_list
N/A N/A 
A collection of hashing and encoding functions
 __future__ absolute_import N/A base64 N/A hashlib N/A hmac N/A StringIO N/A salt.exceptions N/A salt.ext.six six N/A salt.utils digest N/A N/A instr checksum N/A md5 N/A N/A 
    Return a checksum digest for a string

    instr
        A string
    checksum : ``md5``
        The hashing algorithm to use to generate checksums. Valid options: md5,
        sha256, sha512.

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.digest 'get salted'
     N/A hashing_funcs N/A md5 sha256 sha512 N/A __salt__ N/A hashutil.md5_digest N/A __salt__ N/A hashutil.sha256_digest N/A __salt__ N/A hashutil.sha512_digest N/A hash_func N/A N/A hashing_funcs get checksum N/A N/A hash_func None N/A N/A N/A N/A N/A salt exceptions CommandExecutionError N/A N/A Hash func '{0}' is not supported. format checksum N/A N/A hash_func instr N/A digest_file N/A N/A infile checksum N/A md5 N/A N/A 
    Return a checksum digest for a file

    infile
        A file path
    checksum : ``md5``
        The hashing algorithm to use to generate checksums. Wraps the
        :py:func:`hashutil.digest <salt.modules.hashutil.digest>` execution
        function.

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.digest_file /path/to/file
     N/A N/A N/A N/A __salt__ N/A file.file_exists infile N/A N/A N/A N/A N/A salt exceptions CommandExecutionError N/A N/A File path '{0}' not found. format infile N/A N/A open infile rb f N/A N/A file_hash N/A N/A __salt__ N/A hashutil.digest N/A N/A f read checksum N/A file_hash N/A base64_b64encode N/A N/A instr N/A N/A N/A 
    Encode a string as base64 using the "modern" Python interface.

    Among other possible differences, the "modern" encoder does not include
    newline ('\n') characters in the encoded output.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_b64encode 'get salted'
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A b64 N/A N/A base64 b64encode b N/A N/A N/A N/A salt utils to_str b64 N/A N/A N/A base64 b64encode instr N/A base64_b64decode N/A N/A instr N/A N/A N/A 
    Decode a base64-encoded string using the "modern" Python interface

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_b64decode 'Z2V0IHNhbHRlZA=='
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A data N/A N/A base64 b64decode b N/A N/A N/A N/A N/A N/A salt utils to_str data N/A N/A N/A UnicodeDecodeError N/A N/A data N/A N/A N/A base64 b64decode instr N/A base64_encodestring N/A N/A instr N/A N/A N/A 
    Encode a string as base64 using the "legacy" Python interface.

    Among other possible differences, the "legacy" encoder includes
    a newline ('\n') character after every 76 characters and always
    at the end of the encoded string.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_encodestring 'get salted'
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A b64 N/A N/A base64 encodebytes b N/A N/A N/A N/A salt utils to_str b64 N/A N/A N/A base64 encodestring instr N/A base64_encodefile N/A N/A fname N/A N/A N/A 
    Read a file from the file system and return as a base64 encoded string

    .. versionadded:: 2016.3.0

    Pillar example:

    .. code-block:: yaml

        path:
          to:
            data: |
              {{ salt.hashutil.base64_encodefile('/path/to/binary_file') | indent(6) }}

    The :py:func:`file.decode <salt.states.file.decode>` state function can be
    used to decode this data and write it to disk.

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_encodefile /path/to/binary_file
     N/A encoded_f N/A N/A StringIO StringIO N/A N/A open fname rb f N/A N/A N/A N/A base64 encode f encoded_f N/A N/A N/A encoded_f seek 0 N/A N/A N/A encoded_f read N/A base64_decodestring N/A N/A instr N/A N/A N/A 
    Decode a base64-encoded string using the "legacy" Python interface

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_decodestring instr='Z2V0IHNhbHRlZAo='

     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A data N/A N/A base64 decodebytes b N/A N/A N/A N/A N/A N/A salt utils to_str data N/A N/A N/A UnicodeDecodeError N/A N/A data N/A N/A N/A base64 decodestring instr N/A base64_decodefile N/A N/A instr outfile N/A N/A N/A 
    Decode a base64-encoded string and write the result to a file

    .. versionadded:: 2015.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.base64_decodefile instr='Z2V0IHNhbHRlZAo=' outfile='/path/to/binary_file'
     N/A encoded_f N/A N/A StringIO StringIO instr N/A N/A open outfile wb f N/A N/A N/A N/A base64 decode encoded_f f N/A True N/A md5_digest N/A N/A instr N/A N/A N/A 
    Generate an md5 hash of a given string

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.md5_digest 'get salted'
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A N/A N/A N/A N/A hashlib md5 b hexdigest N/A N/A N/A N/A N/A hashlib md5 instr hexdigest N/A sha256_digest N/A N/A instr N/A N/A N/A 
    Generate an sha256 hash of a given string

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.sha256_digest 'get salted'
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A N/A N/A N/A N/A hashlib sha256 b hexdigest N/A N/A N/A N/A N/A hashlib sha256 instr hexdigest N/A sha512_digest N/A N/A instr N/A N/A N/A 
    Generate an sha512 hash of a given string

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.sha512_digest 'get salted'
     N/A N/A six PY3 N/A N/A b N/A N/A N/A salt utils to_bytes instr N/A N/A N/A N/A N/A hashlib sha512 b hexdigest N/A N/A N/A N/A N/A hashlib sha512 instr hexdigest N/A hmac_signature N/A N/A string shared_secret challenge_hmac N/A N/A N/A 
    Verify a challenging hmac signature against a string / shared-secret

    .. versionadded:: 2014.7.0

    Returns a boolean if the verification succeeded or failed.

    CLI Example:

    .. code-block:: bash

        salt '*' hashutil.hmac_signature 'get salted' 'shared secret' 'eBWf9bstXg+NiP5AOwppB5HMvZiYMPzEM9W5YMm/AmQ='
     N/A N/A six PY3 N/A N/A msg N/A N/A N/A salt utils to_bytes string N/A key N/A N/A N/A salt utils to_bytes shared_secret N/A challenge N/A N/A N/A salt utils to_bytes challenge_hmac N/A N/A msg string N/A key shared_secret N/A challenge challenge_hmac N/A hmac_hash N/A N/A hmac new key msg N/A hashlib sha256 N/A valid_hmac N/A N/A base64 b64encode N/A N/A hmac_hash digest N/A N/A valid_hmac challenge N/A