Skip to content

TheMade4/BinaryStream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BinaryStream

BinaryStream library for python

What is it?

This is a library for convenient serialization of standard C/C++ types similar to that used for example in RakNet protocol.

Installation

For Linux/Mac

pip3 install binary-stream

For Windows

pip install binary-stream

Usage

Example

from binary_stream import BinaryStream

write_stream = BinaryStream()

write_stream.write_int8(42)
write_stream.write_bool(True)
write_stream.write_bool(True)

data = write_stream.get_buffer()
print(data.hex())

read_stream = BinaryStream(data)

print(read_stream.read_int8())
print(read_stream.read_bool())
print(read_stream.read_bool())

Credits

This project is inspired by binary_utils

License

This project is open sourced under MIT license, see the LICENSE file for more details.

About

BinaryStream libary for python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages