package
Version:
v0.0.19
Opens a new window with list of versions in this module.
Published: Aug 9, 2023
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
bitmask
Simple utilities for working with bitmasks. Built with generics so any form of unsigned or signed integer is supported.
Documentation
¶
func Add[T Bit](sum, bit T) T
Add adds a given bit to the sum.
Has checks whether a given bit exists in sum.
func Remove[T Bit](sum, bit T) T
Remove removes bit from the sum.
func Toggle[T Bit](sum, bit T) T
Toggle will either add or remove bit from sum depending on whether it currently exists in the bitmask.
Bit is a generic type that exports the supported values that can be used in the bitmask.
Any form of integer is currently supported.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.