github.com/cheng762/platon-go@v1.8.17-0.20190529111256-7deff2d7be26/common/byteutil/byteutil_test.go (about)

     1  // create by platon
     2  package byteutil
     3  
     4  import (
     5  	"fmt"
     6  	"github.com/PlatONnetwork/PlatON-Go/common"
     7  	"math/big"
     8  	"strings"
     9  	"testing"
    10  )
    11  
    12  func TestByteUtil(t *testing.T) {
    13  
    14  	big1 := new(big.Int).SetInt64(1)
    15  	fmt.Println(big1.Bytes())
    16  
    17  	curByte := []byte("f901248800000000000000f19447657442617463685469636b657444657461696cb90103666332336435643363666564373561376438636234616437346461316436613431626265346237663936343035653039346365646634313066326463396638613a623430336631396134356234666636393638356238366238343230653237306335343936303636393765363364626536306265626133663437333964366539333a306461616662326231646135643162376437343266616362663838366165663237343934383435363663623434326536666463306163303437326132646338313a30336134386135636366636232393031646264643363333639376362306262663366343835303134626135656331353539386437343166333138393737656436")
    18  	arrHash := ArrBytesToHash(curByte)
    19  	for i := 0; i < len(arrHash); i++ {
    20  		fmt.Println(arrHash[i].Hex())
    21  	}
    22  
    23  }
    24  
    25  func Test1(t *testing.T) {
    26  	str := "0xb403f19a45b4ff69685b86b8420e270c549606697e63dbe60beba3f4739d6e93"
    27  	a := strings.Split(str, ":")
    28  	fmt.Println(a)
    29  
    30  	b := common.HexToHash("b403f19a45b4ff69685b86b8420e270c549606697e63dbe60beba3f4739d6e93")
    31  	fmt.Println(b.Hex())
    32  }