{"modulePath":"github.com/RNSSolution/prism","version":"v0.31.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package bitarray\n\n## Types\n\n```go\ntype CompactBitArray struct {\n\tExtraBitsStored byte   `json:\"extra_bits\"` // The number of extra bits in elems.\n\tElems           []byte `json:\"bits\"`\n}\n```\nCompactBitArray is an implementation of a space efficient bit array. This is used to ensure that the encoded data takes up a minimal amount of space after amino encoding. This is not thread safe, and is not intended for concurrent usage.\n\n```go\nfunc CompactUnmarshal(bz []byte) (*CompactBitArray, error)\n```\nCompactUnmarshal is a space efficient decoding for CompactBitArray. It is not amino compatible.\n\n```go\nfunc NewCompactBitArray(bits int) *CompactBitArray\n```\nNewCompactBitArray returns a new compact bit array. It returns nil if the number of bits is zero.\n\n```go\nfunc (bA *CompactBitArray) CompactMarshal() []byte\n```\nCompactMarshal is a space efficient encoding for CompactBitArray. It is not amino compatible.\n\n```go\nfunc (bA *CompactBitArray) Copy() *CompactBitArray\n```\nCopy returns a copy of the provided bit array.\n\n```go\nfunc (bA *CompactBitArray) GetIndex(i int) bool\n```\nGetIndex returns the bit at index i within the bit array. The behavior is undefined if i \u003e= bA.Size()\n\n```go\nfunc (bA *CompactBitArray) MarshalJSON() ([]byte, error)\n```\nMarshalJSON implements json.Marshaler interface by marshaling bit array using a custom format: a string of '-' or 'x' where 'x' denotes the 1 bit.\n\n```go\nfunc (bA *CompactBitArray) NumTrueBitsBefore(index int) int\n```\nNumTrueBitsBefore returns the number of bits set to true before the given index. e.g. if bA = \\_XX\\_\\_XX, NumOfTrueBitsBefore(4) = 2, since there are two bits set to true before index 4.\n\n```go\nfunc (bA *CompactBitArray) SetIndex(i int, v bool) bool\n```\nSetIndex sets the bit at index i within the bit array. The behavior is undefined if i \u003e= bA.Size()\n\n```go\nfunc (bA *CompactBitArray) Size() int\n```\nSize returns the number of bits in the bitarray\n\n```go\nfunc (bA *CompactBitArray) String() string\n```\nString returns a string representation of CompactBitArray: BA{\\\u003cbit-string\u003e}, where \\\u003cbit-string\u003e is a sequence of 'x' (1) and '\\_' (0). The \\\u003cbit-string\u003e includes spaces and newlines to help people. For a simple sequence of 'x' and '\\_' characters with no spaces or newlines, see the MarshalJSON() method. Example: \"BA{\\_x\\_}\" or \"nil-BitArray\" for nil.\n\n```go\nfunc (bA *CompactBitArray) StringIndented(indent string) string\n```\nStringIndented returns the same thing as String(), but applies the indent at every 10th bit, and twice at every 50th bit.\n\n```go\nfunc (bA *CompactBitArray) UnmarshalJSON(bz []byte) error\n```\nUnmarshalJSON implements json.Unmarshaler interface by unmarshaling a custom JSON description.\n\n","path":"github.com/RNSSolution/prism/crypto/multisig/bitarray","name":"bitarray","synopsis":"","isRedistributable":true}
