fixup! adlin: able to tokenize every arguments
This commit is contained in:
parent
6df70342af
commit
d8fb2443c7
@ -8,7 +8,10 @@ import (
|
|||||||
func GenerateToken(pkey []byte, id int, a... []byte) ([]byte, error) {
|
func GenerateToken(pkey []byte, id int, a... []byte) ([]byte, error) {
|
||||||
h := sha512.New()
|
h := sha512.New()
|
||||||
|
|
||||||
h.Write([]byte(fmt.Sprintf("%x:%d", pkey, id)))
|
h.Write([]byte(fmt.Sprintf("%x", pkey)))
|
||||||
|
if id != 0 {
|
||||||
|
h.Write([]byte(fmt.Sprintf(":%d", id)))
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range a {
|
for _, v := range a {
|
||||||
h.Write([]byte(":"))
|
h.Write([]byte(":"))
|
||||||
|
Reference in New Issue
Block a user