func CommonPrefixLen(a, b string) int {
	var aa, bb byte
	var i, j int
	for i = 0; i < 20; i++ {
		if a[i] != b[i] {
			aa, bb = a[i], b[i]
			break
		}
	}
	v := aa ^ bb
	for j = 1; j <= 8; j++ {
		if (v >> uint(8-j)) > 0 {
			break
		}
	}
	return i*8 + j - 1
}
CommonPrefixLen returns the length of common prefix
package tools
import (
	"crypto/rand"
	"encoding/binary"
	"errors"
	"net"
)
func RandomString(size uint) string {
	if size == 0 {
		return ""
	}
	buf := make([]byte, size)
	rand.Read(buf)
	return string(buf)
}