github.com/qjfoidnh/BaiduPCS-Go@v0.0.0-20231011165705-caa18a3765f3/baidupcs/netdisksign/sign2_test.go (about)

     1  package netdisksign_test
     2  
     3  import (
     4  	"fmt"
     5  	"github.com/qjfoidnh/Baidu-Login/bdcrypto"
     6  	"github.com/qjfoidnh/BaiduPCS-Go/baidupcs/netdisksign"
     7  	"testing"
     8  )
     9  
    10  func TestSign2(t *testing.T) {
    11  	standard := bdcrypto.Base64Decode([]byte("8RxCbsVeSzn2UjxJAAiV9QQs/WetOj2FJUGwjsMG6SgxFMWlLS/U1Q=="))
    12  	fmt.Println("standard,", standard)
    13  	fmt.Printf("standard s %s\n", standard)
    14  
    15  	res := netdisksign.Sign2([]rune("e8c7d729eea7b54551aa594f942decbe"), []rune("37dbe07ade9359c1aa70807e847f768c13360ad2"))
    16  	fmt.Println(res)
    17  	fmt.Printf("%s\n", string(res))
    18  	fmt.Println([]byte(string(res)))
    19  	fmt.Println(bdcrypto.Base64Encode([]byte(string(res))))
    20  }