Skip to content

Commit

Permalink
remove unused function reverseBytesBits
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 19, 2021
1 parent e66162b commit 3d74fe1
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"math/big"
"math/bits"
"strings"

kbucket "github.com/libp2p/go-libp2p-kbucket"
Expand All @@ -28,15 +27,6 @@ func BytesKey(b []byte) Key {
// First bit (in each byte) is least significant.
type Key []byte

// reverseBytesBits reverses the bit-endianness of each byte in a slice.
func reverseBytesBits(blob []byte) []byte {
r := make([]byte, len(blob))
for i := range blob {
r[i] = bits.Reverse8(blob[i])
}
return r
}

func (k Key) BitAt(offset int) byte {
if k[offset/8]&(byte(1)<<(7-offset%8)) == 0 {
return 0
Expand Down

0 comments on commit 3d74fe1

Please sign in to comment.