fixup! adlin: able to tokenize every arguments

This commit is contained in:
nemunaire 2018-02-23 20:37:08 +01:00 committed by Pierre-Olivier Mercier
parent 6df70342af
commit d8fb2443c7

View File

@ -8,7 +8,10 @@ import (
func GenerateToken(pkey []byte, id int, a... []byte) ([]byte, error) {
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 {
h.Write([]byte(":"))