Skip to content

"Real" bytes in python, because standard bytes() doesn't work properly with bitwise operations

License

Notifications You must be signed in to change notification settings

YeahNotSewerSide/RBytes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

RBytes

"Real" bytes in python, because standart bytes() doesn't work properly

I wrote that because bytes() in python doesn't allow to do bit shiftings and other bitwise operations

Installation

pip install RBytes

Some Examples

from RBytes import RBytes

byte_array = RBytes(b'\x01\x01\x01\x01')

result = byte_array << 5 #bitwise left shift
from RBytes import RBytes
import struct

converted_int = struct.pack('i',69) #get 4 bytes

byte_array = RBytes(converted_int) #get 'real' bytes

result = byte_array << 5 #bitwise left shift

About

"Real" bytes in python, because standard bytes() doesn't work properly with bitwise operations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages