func FromKeys(pub, priv []byte) (*Node, error) {
	hfunc, err := hashFunc(hname)
	if err != nil {
		return nil, err
	}
	_, err = hfunc.Write(pub)
	if err != nil {
		return nil, err
	}
	hsum := hfunc.Sum(nil)
	hash, err := mh.EncodeName(hsum, hname)
	if err != nil {
		return nil, err
	}
	return &Node{
		ID:      mh.Multihash(hash),
		PubKey:  pub,
		PrivKey: priv,
	}, nil
}
// FromKeys creates new Node struct from public and private keys
// by generating node id as multihash of SHA1 of public key.
FromKeys creates new Node struct from public and private keys
by generating node id as multihash of SHA1 of public key.
// FromKeys creates new Node struct from public and private keys // by generating node id as multihash of SHA1 of public key .
func FromKeys(pub, priv []byte) (*Node, error) {
	hfunc, err := hashFunc(hname)
	if err != nil {
		return nil, err
	}
	_, err = hfunc.Write(pub)
	if err != nil {
		return nil, err
	}
	hsum := hfunc.Sum(nil)
	hash, err := mh.EncodeName(hsum, hname)
	if err != nil {
		return nil, err
	}
	return &Node{
		ID:      mh.Multihash(hash),
		PubKey:  pub,
		PrivKey: priv,
	}, nil
}
func FromKeys ( pub , priv [ ] byte ) ( * Node , error ) { hfunc , err := hashFunc ( hname ) if err != nil { return nil , err } _ , err = hfunc . Write ( pub ) if err != nil { return nil , err } hsum := hfunc . Sum ( nil ) hash , err := mh . EncodeName ( hsum , hname ) if err != nil { return nil , err } return & Node { ID : mh . Multihash ( hash ) , PubKey : pub , PrivKey : priv , } , nil }
FromKeys creates new Node struct from public and private keys
by generating node id as multihash of SHA1 of public key.
FromKeys creates new Node struct from public and private keys by generating node id as multihash of SHA1 of public key .