replication master side

This commit is contained in:
finley
2022-11-21 23:36:35 +08:00
parent a7a3da6e49
commit ba7ea942cb
23 changed files with 886 additions and 217 deletions

View File

@@ -16,3 +16,13 @@ func RandString(n int) string {
}
return string(b)
}
var hexLetters = []rune("0123456789abcdef")
func RandHexString(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = hexLetters[rand.Intn(len(hexLetters))]
}
return string(b)
}