mirror of
https://github.com/luxfi/threshold.git
synced 2026-10-30 15:15:53 +00:00
10 lines
243 B
Go
10 lines
243 B
Go
package ot
|
|
|
|
// bitAt returns the ith bit in a vector of bits.
|
|
//
|
|
// The indexing goes from bytes 0..len() - 1, and from the LSB to the MSB inside
|
|
// of each byte.
|
|
func bitAt(i int, data []byte) byte {
|
|
return (data[i>>3] >> (i & 0b111)) & 1
|
|
}
|