jrebelsign.go 584 B

123456789101112131415161718
  1. package main
  2. import (
  3. "strconv"
  4. )
  5. //服务端随机数,如果要自己生成,务必将其写到json的serverRandomness中
  6. const serverRandomness string = "H2ulzLlh7E0="
  7. func toLeaseCreateJson(clientRandomness string, guid string, offline bool, validFrom string, validUntil string) string {
  8. var s2 string
  9. if offline {
  10. s2 = clientRandomness + ";" + serverRandomness + ";" + guid + ";" + strconv.FormatBool(offline) + ";" + validFrom + ";" + validUntil
  11. } else {
  12. s2 = clientRandomness + ";" + serverRandomness + ";" + guid + ";" + strconv.FormatBool(offline)
  13. }
  14. return s2
  15. }