From 271c66fecdd05ba1dceaa83a6ca2a0a0076b5a68 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 15 Jan 2020 18:58:49 +0800 Subject: [PATCH] test --- job.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/job.go b/job.go index d596b76..ef82c23 100644 --- a/job.go +++ b/job.go @@ -7,6 +7,7 @@ import ( "crypto/aes" "crypto/sha256" "encoding/binary" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -18,7 +19,6 @@ import ( "strings" "time" - "github.com/lytics/base62" tb "gopkg.in/tucnak/telebot.v2" ) @@ -1576,18 +1576,14 @@ func jobGWithdraw(j Job) { sha128 := sha256[:aes.BlockSize] c, err := aes.NewCipher(sha128) - in := make([]byte, 0) - buf := make([]byte, 8) - binary.LittleEndian.PutUint64(buf, uint64(id)) - in = append(in, buf...) - binary.LittleEndian.PutUint64(buf, uint64(j.UserID64)) - in = append(in, buf...) + in := make([]byte, 8) + binary.LittleEndian.PutUint64(in, uint64(id)) out := make([]byte, len(in)) c.Encrypt(out, in) - out = append(out, byte(0)) - out = append(out, byte(0)) - ref := base62.StdEncoding.EncodeToString(out) + out = append(out, 0) + out = append(out, 0) + ref := hex.StdEncoding.EncodeToString(out) log.Printf("jobGWithdraw[%d] : got all the info for ref %s\n", j.ID64, string(ref)) }