bitmap

package
v0.0.0-...-b5ae28e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2020 License: 0BSD Imports: 2 Imported by: 0

README

Owner

lh1814

Author

lh1814

Reviewer

Description

算法和数据结构应用小工具
bitmap ---------------> lh1814

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteIndexIsOne

func ByteIndexIsOne(a byte, index int) bool

判断一个byte的指定位置是否为1,顺序为从高位到低位下标分别为0->7

func ByteReverse

func ByteReverse(b byte) byte

func GetBit

func GetBit(s []uint8, index int) (r bool)

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>以下函数为测试,封装好类型的在上面<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 从第0位开始判断

Types

type BitMap

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

func NewBitMapFromBase64String

func NewBitMapFromBase64String(s string) (*BitMap, error)

func NewBitMapFromString

func NewBitMapFromString(s string) *BitMap

从string加载

func (*BitMap) Base64String

func (b *BitMap) Base64String() string

base64转化为string

func (*BitMap) CancelBit

func (b *BitMap) CancelBit(index int)

设置指定位置为0

func (*BitMap) Count

func (b *BitMap) Count() uint64

func (*BitMap) IsBit

func (b *BitMap) IsBit(index int) (r bool)

判断指定位置是否为1

func (*BitMap) Length

func (b *BitMap) Length() int

获取当前位数长度

func (*BitMap) Reset

func (b *BitMap) Reset()

func (*BitMap) SetBit

func (b *BitMap) SetBit(index int)

设置指定位置为1

func (*BitMap) String

func (b *BitMap) String() string

转 string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL