Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //create a big int for test and set to 1
- b1 := new(big.Int)
- b1.SetInt64(1)
- //create empty array with 32 bytes for padding
- empty := make([]byte,32)
- //turn the big int into a hex string (let me know if there is a more
- //elegant way^^)
- String := bytes.NewBufferString(b1.Text(16))
- copy(empty[len(empty)-len(String.Bytes()):],String.Bytes())
- //output of empty : [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49]
- res:= new(big.Int)
- temp:=sha3.Sum256(empty)
- res.SetBytes(temp[:])
- fmt.Println("nresult ",res.Text(16))
- sha3(uint(1))
- b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6
Add Comment
Please, Sign In to add comment