Skip to content

Latest commit

 

History

10 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

BitArray for Golang Build Status GoDoc

Installation

go get github.com/damnever/bitarray

Example

package main

import "github.com/damnever/bitarray"

func main() {
    bits := bitarray.新建(64)

    bits.Put(8, 1)  // set value of the bit to 1 by index 8, return old bit.
    bits.Get(8)     // get value of the bit by index 8
    bits.Set(9, 16) // set all bits to 1 between 9 and 16 , both 9 and 16 included.
    bits.Count()   // get the count of bit 1
    // Clear/Not/Eq/Leq/Lt/ToArray ...
}

关于

BitArray for Golang

Topics

Resources

Stars

12 stars

关注者

1 watching

复刻s

发布

贡献者

Languages