Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chimehq/binarycursor
Go binary data reader
https://github.com/chimehq/binarycursor
binary go parsing
Last synced: about 3 hours ago
JSON representation
Go binary data reader
- Host: GitHub
- URL: https://github.com/chimehq/binarycursor
- Owner: ChimeHQ
- License: bsd-3-clause
- Created: 2021-07-12T10:53:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-25T17:20:47.000Z (about 1 year ago)
- Last Synced: 2024-06-20T22:34:33.853Z (5 months ago)
- Topics: binary, go, parsing
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# binarycursor
This is a small library that implements a stateful cursor which can read binary data of various types. Handy for parsing binary formats.
## usage
```go
reader := bytes.NewReader(data)
c := NewBinaryCursor(reader)// basic types
_, err := c.ReadUint8()
_, err := c.ReadUint16()
_, err := c.ReadUint32()
_, err := c.ReadUint64()// strings
_, err := c.ReadNullTerminatedUTF8String()// LEB128
_, err := c.ReadUleb128()
_, err := c.ReadSleb128()
```### Suggestions or Feedback
We'd love to hear from you! Get in touch via an issue or pull request.
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.