init
This commit is contained in:
commit
38355d2442
9083 changed files with 1225834 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
# Module pygame.tests.test_utils.endian
|
||||
#
|
||||
# Machine independent conversion to little-endian and big-endian Python
|
||||
# integer values.
|
||||
|
||||
import struct
|
||||
|
||||
|
||||
def little_endian_uint32(i):
|
||||
"""Return the 32 bit unsigned integer little-endian representation of i"""
|
||||
|
||||
s = struct.pack("<I", i)
|
||||
return struct.unpack("=I", s)[0]
|
||||
|
||||
|
||||
def big_endian_uint32(i):
|
||||
"""Return the 32 bit unsigned integer big-endian representation of i"""
|
||||
|
||||
s = struct.pack(">I", i)
|
||||
return struct.unpack("=I", s)[0]
|
||||
Loading…
Add table
Add a link
Reference in a new issue