Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active May 30, 2023 20:08
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/6e0b9a41adde6befd39690d1cf127636 to your computer and use it in GitHub Desktop.
Save miguelmota/6e0b9a41adde6befd39690d1cf127636 to your computer and use it in GitHub Desktop.
Golang hex to big int
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