Skip to content
/ bitmask Public

Arbitrary size bitmask (aka bitset) with efficient Slice method

License

Notifications You must be signed in to change notification settings

astef/bitmask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitmask

Go Reference

Arbitrary size bitmask (aka bitset) with efficient Slice method.

bm := bitmask.New(4)        // [4]{0000}
bm.Set(3)                   // [4]{0001}
bm.Slice(2, 4).ToggleAll()  // [4]{0010}
bm.Slice(1, 3).ToggleAll()  // [4]{0100}
bm.Slice(0, 2).ToggleAll()  // [4]{1000}
bm.Clear()                  // [4]{0000}

About

Arbitrary size bitmask (aka bitset) with efficient Slice method

Topics

Resources

License

Stars

Watchers

Forks

Languages