/usr/lib/python2.6/site-packages/rsa
NameSizeModeActions
asn1.py17810644editdlrm
asn1.pyc16530644editdlrm
asn1.pyo16530644editdlrm
bigfile.py51850644editdlrm
bigfile.pyc47860644editdlrm
bigfile.pyo47860644editdlrm
cli.py121850644editdlrm
cli.pyc133190644editdlrm
cli.pyo133190644editdlrm
common.py46400644editdlrm
common.pyc42350644editdlrm
common.pyo42350644editdlrm
core.py16560644editdlrm
core.pyc14850644editdlrm
core.pyo14850644editdlrm
key.py228670644editdlrm
key.pyc239860644editdlrm
key.pyo239860644editdlrm
parallel.py22990644editdlrm
parallel.pyc20980644editdlrm
parallel.pyo20980644editdlrm
pem.py35370644editdlrm
pem.pyc28430644editdlrm
pem.pyo28430644editdlrm
pkcs1.py122300644editdlrm
pkcs1.pyc111730644editdlrm
pkcs1.pyo111260644editdlrm
prime.py45600644editdlrm
prime.pyc36640644editdlrm
prime.pyo36180644editdlrm
randnum.py26430644editdlrm
randnum.pyc20740644editdlrm
randnum.pyo20740644editdlrm
transform.py68920644editdlrm
transform.pyc58560644editdlrm
transform.pyo58560644editdlrm
util.py30590644editdlrm
util.pyc25200644editdlrm
util.pyo24490644editdlrm
varblock.py54060644editdlrm
varblock.pyc48560644editdlrm
varblock.pyo48560644editdlrm
_compat.py38900644editdlrm
_compat.pyc36550644editdlrm
_compat.pyo36550644editdlrm
_version133.py117640644editdlrm
_version133.pyc136390644editdlrm
_version133.pyo136390644editdlrm
_version200.py151230644editdlrm
_version200.pyc152640644editdlrm
_version200.pyo152640644editdlrm
__init__.py14760644editdlrm
__init__.pyc11120644editdlrm
__init__.pyo11120644editdlrm
Edit: /usr/lib/python2.6/site-packages/rsa/transform.pyo (5856B)
Ñò Ï€öVc @@sþdZddklZyddkZeiƒWnej onXddkZddklZddk l Z ddk l Z l Z lZlZlZlZd„Zdd„Zed „Zdded „Zed joddkZeiƒndS( sNData transformation functions. From bytes to a number, number to bytes, etc. i(tabsolute_importN(tpack(tcommon(t is_integertbtbytetget_word_alignmentt ZERO_BYTEt EMPTY_BYTEcC@stti|ƒdƒS(sî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(b'\x80@\x0f') 8405007 i(tinttbinasciithexlify(t raw_bytes((s1/usr/lib/python2.6/site-packages/rsa/transform.pyt bytes2int(s cC@s/t|ƒptd|iƒ‚n|djotd|ƒ‚n|djod}tg}nti|ƒ}g}|o8|djo+||jotd||fƒ‚q¹nx6|djo(|idt |d@ƒƒ|dL}q¼W|o|djo||t}nt }|t i |ƒS(sMConverts a number to a string of bytes. Usage:: >>> _int2bytes(123456789) b'\x07[\xcd\x15' >>> bytes2int(_int2bytes(123456789)) 123456789 >>> _int2bytes(123456789, 6) b'\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. s-You must pass an integer for 'number', not %sis#Negative numbers cannot be used: %iis0Needed %i bytes for number, but block size is %iiÿi( Rt TypeErrort __class__t ValueErrorRRt byte_sizet OverflowErrortinsertRRtjoin(tnumbert block_sizet needed_bytesR tpadding((s1/usr/lib/python2.6/site-packages/rsa/transform.pyt _int2bytes7s,      cC@sAd}|d}x*|D]"}||jo|d7}qPqW|S(s 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. ii((R tneedletleadingt_bytetx((s1/usr/lib/python2.6/site-packages/rsa/transform.pyt bytes_leadingxs  cC@s”|djotd|ƒ‚n|o|otdƒ‚n|d@tdƒ}|}t|ƒ\}}}} d| } x3|djo%t| ||@ƒ|}||L}q~Wt|ƒ} |djo t}n|| }t|ƒ} |oR|djoE| o'| |jotd| |fƒ‚n|i|tƒ}nN|oF|djo9| |} | o$|| }|i| |tƒ}qn|S(s) 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. is&Number must be an unsigned integer: %ds/You can either fill or pad chunks, but not bothits>%ss-Need %d bytes for number, but fill size is %d( RRRRRRtlenRtrjust(Rt fill_sizet chunk_sizetoverflowR tnumt word_bitst_tmax_uintt pack_typet pack_formatt zero_leadingtlengtht remaindert padding_size((s1/usr/lib/python2.6/site-packages/rsa/transform.pyt int2bytes‘s<#           t__main__(t__doc__t __future__Rtpsycotfullt ImportErrorR tstructRtrsaRt rsa._compatRRRRRRR tNoneRRtFalseR/t__name__tdoctestttestmod(((s1/usr/lib/python2.6/site-packages/rsa/transform.pyts"  .  A L