Module Expr Str ImportFrom alias TryExcept body Import alias Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias alias FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr If CompareLt NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad If CompareEq NameLoad Num body Assign NameStore Num Assign NameStore ListLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad If BoolOpAnd NameLoad CompareGt NameLoad Num body If CompareGt NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad While CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr Num Call NameLoad BinOpBitAnd NameLoad Num AugAssignRShift NameStore Num If BoolOpAnd NameLoad CompareGt NameLoad Num body Assign NameStore BinOpMult BinOpSub NameLoad NameLoad NameLoad orelse Assign NameStore NameLoad Return BinOpAdd NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Num Assign NameStore SubscriptLoad NameLoad Index Num For NameStore NameLoad body If CompareEq NameLoad NameLoad body AugAssignAdd NameStore Num orelse Break Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareLt NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad If BoolOpAnd NameLoad NameLoad body Raise Call NameLoad Str Expr BinOpBitAnd NameLoad Num Assign NameStore Call NameLoad Str Assign NameStore NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad While CompareGt NameLoad Num body Assign NameStore BinOpAdd Call NameLoad NameLoad BinOpBitAnd NameLoad NameLoad NameLoad AugAssignRShift NameStore NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpAnd NameLoad CompareGt NameLoad Num body If BoolOpAnd UnaryOpNot NameLoad CompareGt NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If BoolOpAnd NameLoad CompareGt NameLoad Num body Assign NameStore BinOpMod NameLoad NameLoad If NameLoad body Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Import alias Expr Call AttributeLoad NameLoad attr
N/A N/A Data transformation functions.

From bytes to a number, number to bytes, etc.
 __future__ absolute_import N/A N/A N/A psyco N/A N/A N/A psyco full N/A N/A N/A ImportError N/A N/A N/A binascii struct pack rsa common rsa._compat is_integer b byte get_word_alignment ZERO_BYTE EMPTY_BYTE bytes2int N/A N/A raw_bytes N/A N/A N/A Converts a list of bytes or an 8-bit string to an integer.

    When using unicode strings, encode it to some encoding like UTF8 first.

    >>> (((128 * 256) + 64) * 256) + 15
    8405007
    >>> bytes2int('\x80@\x0f')
    8405007

     N/A N/A int N/A N/A binascii hexlify raw_bytes 16 N/A _int2bytes N/A N/A number block_size N/A None N/A N/A Converts a number to a string of bytes.

    Usage::

        >>> _int2bytes(123456789)
        '\x07[\xcd\x15'
        >>> bytes2int(_int2bytes(123456789))
        123456789

        >>> _int2bytes(123456789, 6)
        '\x00\x00\x07[\xcd\x15'
        >>> bytes2int(_int2bytes(123456789, 128))
        123456789

        >>> _int2bytes(123456789, 3)
        Traceback (most recent call last):
        ...
        OverflowError: Needed 4 bytes for number, but block size is 3

    @param number: the number to convert
    @param block_size: the number of bytes to output. If the number encoded to
        bytes is less than this, the block will be zero-padded. When not given,
        the returned block is not padded.

    @throws OverflowError when block_size is given and the number takes up more
        bytes than fit into the block.
     N/A N/A N/A is_integer number N/A N/A N/A TypeError N/A You must pass an integer for 'number', not %s N/A number __class__ N/A N/A number 0 N/A N/A N/A ValueError N/A Negative numbers cannot be used: %i number N/A N/A number 0 N/A N/A needed_bytes 1 N/A raw_bytes N/A ZERO_BYTE N/A N/A needed_bytes N/A N/A common byte_size number N/A raw_bytes N/A N/A N/A block_size N/A block_size 0 N/A N/A N/A needed_bytes block_size N/A N/A N/A OverflowError N/A Needed %i bytes for number, but block size is %i N/A needed_bytes block_size N/A N/A number 0 N/A N/A N/A N/A raw_bytes insert 0 N/A byte N/A number 255 N/A number 8 N/A N/A block_size N/A block_size 0 N/A N/A padding N/A N/A block_size needed_bytes ZERO_BYTE N/A N/A padding EMPTY_BYTE N/A N/A padding N/A N/A EMPTY_BYTE join raw_bytes N/A bytes_leading N/A N/A raw_bytes needle N/A ZERO_BYTE N/A N/A 
    Finds the number of prefixed byte occurrences in the haystack.

    Useful when you want to deal with padding.

    :param raw_bytes:
        Raw bytes.
    :param needle:
        The byte to count. Default .
    :returns:
        The number of leading needle bytes.
     N/A leading 0 N/A _byte N/A needle N/A 0 N/A x raw_bytes N/A N/A N/A x _byte N/A N/A leading 1 N/A N/A N/A leading N/A int2bytes N/A N/A number fill_size chunk_size overflow N/A None None False N/A N/A 
    Convert an unsigned integer to bytes (base-256 representation)::

    Does not preserve leading zeros if you don't specify a chunk size or
    fill size.

    .. NOTE:
        You must not specify both fill_size and chunk_size. Only one
        of them is allowed.

    :param number:
        Integer value
    :param fill_size:
        If the optional fill size is given the length of the resulting
        byte string is expected to be the fill size and will be padded
        with prefix zero bytes to satisfy that length.
    :param chunk_size:
        If optional chunk size is given and greater than zero, pad the front of
        the byte string with binary zeros so that the length is a multiple of
        ``chunk_size``.
    :param overflow:
        ``False`` (default). If this is ``True``, no ``OverflowError``
        will be raised when the fill_size is shorter than the length
        of the generated byte sequence. Instead the byte sequence will
        be returned as is.
    :returns:
        Raw bytes (base-256 representation).
    :raises:
        ``OverflowError`` when fill_size is given and the number takes up more
        bytes than fit into the block. This requires the ``overflow``
        argument to this function to be set to ``False`` otherwise, no
        error will be raised.
     N/A N/A number 0 N/A N/A N/A ValueError N/A Number must be an unsigned integer: %d number N/A N/A fill_size chunk_size N/A N/A N/A ValueError You can either fill or pad chunks, but not both N/A N/A number 1 N/A raw_bytes N/A b N/A num number N/A N/A word_bits _ max_uint pack_type N/A get_word_alignment num N/A pack_format N/A >%s pack_type N/A N/A num 0 N/A N/A raw_bytes N/A N/A pack pack_format N/A num max_uint raw_bytes N/A num word_bits N/A zero_leading N/A bytes_leading raw_bytes N/A N/A number 0 N/A N/A raw_bytes ZERO_BYTE N/A raw_bytes N/A raw_bytes N/A zero_leading N/A length N/A len raw_bytes N/A N/A fill_size N/A fill_size 0 N/A N/A N/A N/A overflow N/A length fill_size N/A N/A N/A OverflowError N/A Need %d bytes for number, but fill size is %d N/A length fill_size N/A raw_bytes N/A N/A raw_bytes rjust fill_size ZERO_BYTE N/A N/A N/A chunk_size N/A chunk_size 0 N/A N/A remainder N/A length chunk_size N/A remainder N/A N/A padding_size N/A chunk_size remainder N/A raw_bytes N/A N/A raw_bytes rjust N/A length padding_size ZERO_BYTE N/A raw_bytes N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod