3 M(ÌY2ã@sdZddlmZddlZddlmZy ejZWnek rHej ZYnXdZ dZ dZ ee krdd Z nee krrd Z nd Z yeZWnek r–eZYnXeekrªd d „Znd d „Zy eefZWnek rØefZYnXeZedƒZedƒZdd„Zdd„Zdd„Zd e fdd„ZdS)zPython compatibility wrappers.é)Úabsolute_importN)Úpackéé?ééé@é cCs |jdƒS)NÚlatin1)Úencode)Ús©r ú2/private/tmp/pip-build-nl73fm5q/rsa/rsa/_compat.pyÚ byte_literal5srcCs|S)Nr )r r r rr8súÚcCs t|tƒS)z½ Determines whether the given value is a byte string. :param obj: The value to test. :returns: ``True`` if ``value`` is a byte string; ``False`` otherwise. )Ú isinstanceÚbytes)Úobjr r rÚis_bytesHs rcCs t|tƒS)z· Determines whether the given value is an integer. :param obj: The value to test. :returns: ``True`` if ``value`` is an integer; ``False`` otherwise. )rÚ integer_types)rr r rÚ is_integerTs rcCs td|ƒS)ad Converts a number between 0 and 255 (both inclusive) to a base-256 (byte) representation. Use it as a replacement for ``chr`` where you are expecting a byte because this will work on all current versions of Python:: :param num: An unsigned integer between 0 and 255 (both inclusive). :returns: A single byte. ÚB)r)Únumr r rÚbyte`s rcCsld}d}d}d}|dkr4|dkr4||kr4dd|dfS||krHdd |d fS||kr\d d |d fSdd|dfSdS)aD Returns alignment details for the given number based on the platform Python is running on. :param num: Unsigned integral number. :param force_arch: If you don't want to use 64-bit unsigned chunks, set this to anything other than 64. 32-bit chunks will be preferred then. Default 64 will be used when on a 64-bit machine. :param _machine_word_size: (Internal) The machine word size used for alignment. :returns: 4-tuple:: (word_bits, word_bytes, max_uint, packing_format_type) lÿÿÿÿlÿÿiÿÿéÿréÚQr éÚLééÚHrrNr )rZ force_archZ_machine_word_sizeZ max_uint64Z max_uint32Z max_uint16Z max_uint8r r rÚget_word_alignmentps   r#llÿÿÿÿliÿÿÿi€iÿ)Ú__doc__Ú __future__rÚsysÚstructrÚmaxsizeZMAX_INTÚAttributeErrorZmaxintZ MAX_INT64Z MAX_INT32Z MAX_INT16ZMACHINE_WORD_SIZEÚunicodeZ unicode_typeÚ NameErrorÚstrrÚintÚlongrÚbZ ZERO_BYTEZ EMPTY_BYTErrrr#r r r rÚsD