Skip to content

tvmaly/bitset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitset

a bitset in Go to work with bitstrings represented as hexadecimal values

the motivation was a simple bitstring that could also be used on the frontend javascript side

to keep track of binary flag values

Example:

b := bitset.New(0)

// set bit 15

b.Set(15)

// returns "0f"

hexstring := b.ToHexString()

// returns 1 note things start at zero so this is the 4th bit

bit := b.Get(3)

a := bitset.New(0)

err := a.FromHexString("0f")

if err != nil {

}

About

a bitset in Go to work with bitstrings represented as hexadecimal values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages