|
@@ -2,6 +2,7 @@ package main
|
|
|
|
|
|
import (
|
|
|
"bufio"
|
|
|
+ "crypto/sha1"
|
|
|
"encoding/csv"
|
|
|
"flag"
|
|
|
"fmt"
|
|
@@ -546,9 +547,11 @@ func replayFile() {
|
|
|
natsEC.Publish(config.NatsQueue, &req)
|
|
|
|
|
|
if strings.Index(r[1], ".") < 0 {
|
|
|
+ hash := sha1.New()
|
|
|
+ io.WriteString(hash, r[0])
|
|
|
fp := data.Fingerprint{
|
|
|
ClientID: "scw",
|
|
|
- Fingerprint: fmt.Sprintf("%x%x%x%x\n", rand.Int(), rand.Int(), rand.Int(), rand.Int()),
|
|
|
+ Fingerprint: fmt.Sprintf("%x", hash.Sum(nil)),
|
|
|
Remote: r[0],
|
|
|
Url: r[1],
|
|
|
Source: r[0],
|
|
@@ -558,7 +561,7 @@ func replayFile() {
|
|
|
if strings.HasPrefix(r[0], "50.31.") {
|
|
|
fp.Fingerprint = "a1f2c2ee560ce6580d66d451a9c8dfbf"
|
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
|
- } else if rand.Intn(10) < 8 {
|
|
|
+ } else if rand.Intn(10) < 5 {
|
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
|
}
|
|
|
|