Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
/ bytebits Public

Bitwise and bit-field operations on byte slices for the Go language

License

Notifications You must be signed in to change notification settings

bford/bytebits

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This package implements bitwise and bit-field operations on byte slices in the Go language. These are functions that I wish were in the Go standard library's bytes package, or perhaps a subpackage that might be called bytes/bits.

For full API information please see the Godoc documentation.

In brief, the package includes:

  • Insertion and extraction of bit-fields of arbitrary bit widths at arbitrary bit offsets in a byte slice.
  • Insertion and extraction of single bits and fixed-length integers at arbitrary bit offsets in a byte slice.
  • Support for big-endian and (soon) little-endian bit-ordering.
  • Bitwise And, AndNot, Or, Xor, and Not on byte slices.
  • LeadingZeros, TrailingZeros, and OnesCount on byte slices.

I hope you find it useful! Pull requests welcome.

About

Bitwise and bit-field operations on byte slices for the Go language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.