Skip to content

Latest commit

 

History

10 提交

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

go.dev reference Test 操作 Status Go Report Card codecov

bitstring

Go bitstring library

Package bitstring implements a fixed length bit string type and bit manipulation functions.

  • Get/Set/Clear/Flip a single bit: Bit|SetBit|ClearBit|FlipBit
  • Set/Clear/Flip a range of bits: SetRange|ClearRange|FlipRange
  • 比较 2 bit strings: Equals or EqualsRange
  • 8/16/32/64/N signed/unsigned to/from conversions:
    • Uint8|Uint16|Uint32|Uint64|Uintn
    • SetUint8|SetUint16|SetUint32|SetUint64|SetUintn
  • Count ones/zeroes: ZeroesCount|OnesCount
  • Gray code conversion methods: Gray8|Gray16|Gray32|Gray64|Grayn
  • Convert to/from big.Int: BigInt | 新建FromBig
  • Copy/Clone methods: Copy|Clone|CopyRange
  • Trailing/LeadingZeroes : TrailingZeroes|LeadingZeroes

Debug version

By default, bit offsets arguments to bitstring methods are not checked. This allows not to pay the performance penalty of always checking offsets, in environments where they are constants or always known beforehand.

You can enable runtime checks by passing the bitstring_debug build tag to go when building the bitstring package.

TODO:

关于

Go Bitstring module

Topics

Resources

Stars

1 star

关注者

1 watching

复刻s

发布

贡献者

Languages