Server IP : 85.214.239.14 / Your IP : 18.117.156.84 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/task/3/cwd/proc/self/root/srv/modoboa/env/lib64/python3.5/site-packages/PIL/ |
Upload File : |
# # The Python Imaging Library. # $Id$ # # Binary input/output support routines. # # Copyright (c) 1997-2003 by Secret Labs AB # Copyright (c) 1995-2003 by Fredrik Lundh # Copyright (c) 2012 by Brian Crowell # # See the README file for information on usage and redistribution. # from struct import pack, unpack_from def i8(c): return c if c.__class__ is int else c[0] def o8(i): return bytes((i & 255,)) # Input, le = little endian, be = big endian def i16le(c, o=0): """ Converts a 2-bytes (16 bits) string to an unsigned integer. :param c: string containing bytes to convert :param o: offset of bytes to convert in string """ return unpack_from("<H", c, o)[0] def si16le(c, o=0): """ Converts a 2-bytes (16 bits) string to a signed integer. :param c: string containing bytes to convert :param o: offset of bytes to convert in string """ return unpack_from("<h", c, o)[0] def i32le(c, o=0): """ Converts a 4-bytes (32 bits) string to an unsigned integer. :param c: string containing bytes to convert :param o: offset of bytes to convert in string """ return unpack_from("<I", c, o)[0] def si32le(c, o=0): """ Converts a 4-bytes (32 bits) string to a signed integer. :param c: string containing bytes to convert :param o: offset of bytes to convert in string """ return unpack_from("<i", c, o)[0] def i16be(c, o=0): return unpack_from(">H", c, o)[0] def i32be(c, o=0): return unpack_from(">I", c, o)[0] # Output, le = little endian, be = big endian def o16le(i): return pack("<H", i) def o32le(i): return pack("<I", i) def o16be(i): return pack(">H", i) def o32be(i): return pack(">I", i)