mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-23 18:15:24 +00:00
Merge branch 'develop' into v044
This commit is contained in:
commit
36c754cd0d
@ -108,7 +108,7 @@ func SubnetForKey(publicKey ed25519.PublicKey) *Subnet {
|
|||||||
}
|
}
|
||||||
var snet Subnet
|
var snet Subnet
|
||||||
copy(snet[:], addr[:])
|
copy(snet[:], addr[:])
|
||||||
prefix := GetPrefix()
|
prefix := GetPrefix() // nolint:staticcheck
|
||||||
snet[len(prefix)-1] |= 0x01
|
snet[len(prefix)-1] |= 0x01
|
||||||
return &snet
|
return &snet
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ func SubnetForKey(publicKey ed25519.PublicKey) *Subnet {
|
|||||||
// This is used for key lookup.
|
// This is used for key lookup.
|
||||||
func (a *Address) GetKey() ed25519.PublicKey {
|
func (a *Address) GetKey() ed25519.PublicKey {
|
||||||
var key [ed25519.PublicKeySize]byte
|
var key [ed25519.PublicKeySize]byte
|
||||||
prefix := GetPrefix()
|
prefix := GetPrefix() // nolint:staticcheck
|
||||||
ones := int(a[len(prefix)])
|
ones := int(a[len(prefix)])
|
||||||
for idx := 0; idx < ones; idx++ {
|
for idx := 0; idx < ones; idx++ {
|
||||||
key[idx/8] |= 0x80 >> byte(idx%8)
|
key[idx/8] |= 0x80 >> byte(idx%8)
|
||||||
|
Loading…
Reference in New Issue
Block a user