Server IP : 180.180.241.3 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files/MySQL/MySQL Workbench 6.3 CE/python/site-packages/Crypto/Util/ |
Upload File : |
ó rKXc @ s« d Z d Z d d l Z e j d d k rz d „ Z d „ Z d „ Z d „ Z e j d d k rn d „ Z q§ d „ Z n- d „ Z d „ Z d „ Z d „ Z d „ Z d S( s™ Compatibility code for handling string/bytes changes from Python 2.x to Py3k In Python 2.x, strings (of type ''str'') contain binary data, including encoded Unicode text (e.g. UTF-8). The separate type ''unicode'' holds Unicode text. Unicode literals are specified via the u'...' prefix. Indexing or slicing either type always produces a string of the same type as the original. Data read from a file is always of '''str'' type. In Python 3.x, strings (type ''str'') may only contain Unicode text. The u'...' prefix and the ''unicode'' type are now redundant. A new type (called ''bytes'') has to be used for binary data (including any particular ''encoding'' of a string). The b'...' prefix allows one to specify a binary literal. Indexing or slicing a string produces another string. Slicing a byte string produces another byte string, but the indexing operation produces an integer. Data read from a file is of '''str'' type if the file was opened in text mode, or of ''bytes'' type otherwise. Since PyCrypto aims at supporting both Python 2.x and 3.x, the following helper functions are used to keep the rest of the library as independent as possible from the actual Python version. In general, the code should always deal with binary strings, and use integers instead of 1-byte character strings. b(s) Take a text string literal (with no prefix or with u'...' prefix) and make a byte string. bchr(c) Take an integer and make a 1-character byte string. bord(c) Take the result of indexing on a byte string and make an integer. tobytes(s) Take a text string, a byte string, or a sequence of character taken from a byte string and make a byte string. s $Id$iÿÿÿÿNi i c C s | S( N( ( t s( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt bB s c C s t | ƒ S( N( t chr( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt bchrD s c C s t | ƒ S( N( t str( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt bstrF s c C s t | ƒ S( N( t ord( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt bordH s i c C s) y | j d ƒ SWn d j | ƒ SXd S( Ns latin-1t ( t encodet join( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt tobytesK s c C s- t | t ƒ r | j d ƒ Sd j | ƒ Sd S( Ns latin-1R ( t isinstancet unicodeR R ( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR Q s c C s | j d ƒ S( Ns latin-1( R ( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR W s c C s t | g ƒ S( N( t bytes( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR Y s c C s* t | t ƒ r t | d ƒ St | ƒ Sd S( Ns latin-1( R R R ( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR [ s c C s | S( N( ( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR ` s c C s= t | t ƒ r | St | t ƒ r/ | j d ƒ St | ƒ Sd S( Ns latin-1( R R R R ( R ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyR b s ( t __doc__t __revision__t syst version_infoR R R R R ( ( ( s[ C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\Crypto\Util\py3compat.pyt <module>; s