Skip to content

Latest commit

 

History

History
87 lines (47 loc) · 1.55 KB

README.md

File metadata and controls

87 lines (47 loc) · 1.55 KB

bitmap

import "github.com/andy2046/bitmap"

Package bitmap implements Bitmap in Go.

bitmap.go

const MaxBitmapSize uint64 = 0x01 << 40

MaxBitmapSize is the maximum bitmap size (in bits).

type Bitmap struct {
    // contains filtered or unexported fields
}

Bitmap represents a bitmap.

func New(size uint64) *Bitmap

New creates a new Bitmap.

func (*Bitmap) GetBit

func (b *Bitmap) GetBit(offset uint64) bool

GetBit returns the value of bit at offset.

func (*Bitmap) SetBit

func (b *Bitmap) SetBit(offset uint64, v bool) bool

SetBit sets bit at offset to value v.

func (*Bitmap) Size

func (b *Bitmap) Size() uint64

Size returns the bitmap size (in bits).