// given an address // generate a new encryption key for it // return the encryption key and the encrypted address func NewAddrEnc(addr string) (string, string) { key_bytes := nacl.RandBytes(encAddrBytes()) key := base64.StdEncoding.EncodeToString(key_bytes) return key, EncAddr(addr, key) }
// make a random string func randStr(length int) string { return hex.EncodeToString(nacl.RandBytes(length))[length:] }