Skip to content

andy2046/bitmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).