https://github.com/wgrape/bitmap
A simple and easy-to-use bitmap library based on Go language / 一个基于Go语言实现的简单易用的bitmap库
https://github.com/wgrape/bitmap
Last synced: about 1 year ago
JSON representation
A simple and easy-to-use bitmap library based on Go language / 一个基于Go语言实现的简单易用的bitmap库
- Host: GitHub
- URL: https://github.com/wgrape/bitmap
- Owner: WGrape
- License: mit
- Created: 2022-02-27T04:27:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-27T07:10:39.000Z (over 4 years ago)
- Last Synced: 2025-04-24T00:04:02.367Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Bitmap
A simple and easy-to-use bitmap library based on Go language.
## Usage
```go
m1 := Bitmap{}
m1.Add(1)
m1.Add(10)
m1.Add(999)
m2 := Bitmap{}
m2.Add(1)
m2.Add(10)
m2.Add(998)
m1.IntersectWith(&m2)
fmt.Printf("%v", m1.Elems())
```
## API
- ```Add``` :add the element to the set
- ```Remove``` :remove the element in the set
- ```Clear``` :make the bitmap empty
- ```Copy``` :copy the bitmap to a new bitmap
- ```Has``` :whether the element already exists in the set
- ```Elems``` :return the every element in the set
- ```UnionWith``` :calculate the unionSet
- ```IntersectWith``` :calculate the interSet
- ```DifferenceWith``` :calculate the differenceSet
## License
MIT