Documentation ¶
Overview ¶
Package bitmap implements bitmaps that maintain their length in bytes and behave compatibly with the bitfields used in the BitTorrent protocol.
Index ¶
- type Bitmap
- func (b Bitmap) All(n int) bool
- func (b Bitmap) Copy() Bitmap
- func (b Bitmap) Count() int
- func (b Bitmap) Empty() bool
- func (b1 Bitmap) EqualValue(b2 Bitmap) bool
- func (b *Bitmap) Extend(i int)
- func (b Bitmap) Get(i int) bool
- func (b Bitmap) Len() int
- func (b Bitmap) Range(f func(index int) bool)
- func (b *Bitmap) Reset(i int)
- func (b *Bitmap) Set(i int)
- func (b *Bitmap) SetMultiple(n int)
- func (b Bitmap) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitmap ¶
type Bitmap []uint8
func (Bitmap) EqualValue ¶
EqualValue returns true if two bitmaps have the same bits set (ignoring any trailing zeroes).
func (*Bitmap) Extend ¶
Extend sets the length of the bitmap to at least the smallest multiple of 8 that is strictly larger than i.
func (Bitmap) Range ¶
Range applies a given function on all set values in a bitmap in increasing order. The iteration is interrupted when the function returns false.
Click to show internal directories.
Click to hide internal directories.