Skip to content
Snippets Groups Projects
Commit 9778f230 authored by Xavier Perret's avatar Xavier Perret
Browse files

added rand function

parent ab01bb30
No related branches found
No related tags found
1 merge request!2added file to separate client function from the server
......@@ -2,8 +2,11 @@ package utilities
import (
"fmt"
"math/rand"
"net"
. "node/types"
"strconv"
"time"
)
func PrintTransaction(trans Transaction) {
......@@ -115,4 +118,10 @@ func TranslateMessageToTransaction(mess Message) Transaction {
newTrans.Amount = body["amount"].(string)
return newTrans
}
func RandomString() string {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
return strconv.Itoa(r.Int())
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment