Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Shorter default node ID.

Contemplating always requiring the user to suppy one, but this is at
least more usable.

Closes #111
  • Loading branch information...
commit b43a34abf26cde56fb0175ef278e38d667e4b29c 1 parent 8dcee2b
@dustin dustin authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 registry.go
View
6 registry.go
@@ -1,6 +1,7 @@
package main
import (
+ "encoding/hex"
"encoding/json"
"errors"
"flag"
@@ -92,7 +93,10 @@ func initServerId() error {
serverId = strings.TrimSpace(string(bytes))
} else {
if serverId == "" {
- serverId = time.Now().UTC().Format(time.RFC3339Nano)
+ h := getHash()
+ t := time.Now().UTC().Format(time.RFC3339Nano)
+ h.Write([]byte(t))
+ serverId = hex.EncodeToString(h.Sum(nil))[:8]
}
}
return err
Please sign in to comment.
Something went wrong with that request. Please try again.