Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaileke authored Aug 19, 2024
1 parent d38a913 commit 88278b6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
# binary-utils
A binary system to be used for RakNet protocol.

## Usage

📄Cargo.toml
```css
[dependencies]
binary-utils = { git = "https://github.com/ismaileke/binary-utils.git", branch = "master"}
```


📄main.rs
```rust
use binary_utils::binary::Stream;

fn main() {
let mut stream = Stream::new(vec![1, 2], 0);
stream.put_byte(128);
stream.put_l_triad(12345);

let _ = stream.get_byte(); // first byte -> 1
let _ = stream.get_byte(); // second byte -> 2
let _ = stream.get_byte(); // third byte -> 128
let triad_num = stream.get_l_triad(); // triad number -> 12345

println!("{}", triad_num); // 12345
println!("{:?}", stream.get_buffer()); // [1, 2, 128, 57, 48, 0]
}
```

## 📍 NOTE
It is still in development.

0 comments on commit 88278b6

Please sign in to comment.