Last active
May 30, 2023 20:08
-
-
Save miguelmota/6e0b9a41adde6befd39690d1cf127636 to your computer and use it in GitHub Desktop.
Golang hex to big int
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
func main() { | |
s := "a" | |
i := new(big.Int) | |
i.SetString(s, 16) | |
fmt.Println(i) // 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment