repositorypackage
0.0.0-20230825172046-f9a5c882a482
Repository: https://github.com/chimehq/binarycursor.git
Documentation: pkg.go.dev
# 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
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. By participating in this project you agree to abide by its terms.