import (
"crypto/rand"
"errors"
+ "fmt"
"sync"
"time"
"golang.org/x/crypto/nacl/box"
)
+const DummyB32Id = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+
type NodeId [blake2b.Size256]byte
func (id NodeId) String() string {
func NodeIdFromString(raw string) (*NodeId, error) {
decoded, err := Base32Codec.DecodeString(raw)
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("Can not parse node: %s: %s", raw, err)
}
if len(decoded) != blake2b.Size256 {
return nil, errors.New("Invalid node id size")