|
|
@@ -372,7 +372,7 @@ func (k *Key) Develop() { |
|
|
|
} |
|
|
|
|
|
|
|
func (k *Key) GenerateToken() error { |
|
|
|
buf_int64 := make([]byte, 8) // 8 bytes = 64 bits |
|
|
|
buf_int64 := make([]byte, 10) // 8 bytes = 64 bits |
|
|
|
input := []byte{} |
|
|
|
if randomizeTokens { |
|
|
|
max := big.NewInt(2 ^ 16 - 1) |
|
|
@@ -383,11 +383,11 @@ func (k *Key) GenerateToken() error { |
|
|
|
} |
|
|
|
} |
|
|
|
binary.PutVarint(buf_int64, k.ID) |
|
|
|
input = append(input, buf_int64...) |
|
|
|
input = append(input, buf_int64[0:8]...) |
|
|
|
binary.PutVarint(buf_int64, k.Player) |
|
|
|
input = append(input, buf_int64...) |
|
|
|
input = append(input, buf_int64[0:8]...) |
|
|
|
binary.PutVarint(buf_int64, k.Time) |
|
|
|
input = append(input, buf_int64...) |
|
|
|
input = append(input, buf_int64[0:8]...) |
|
|
|
bToken := sha512.Sum512(input) |
|
|
|
//k.Token = string(bToken) |
|
|
|
k.Token = "" |
|
|
|