Is there a way to convert a string (which is essentially a huge number) from string to Big int in Go?
I tried to first convert it into bytes array
array :
See Example for string to big int conversion.
package main import ( "fmt" "log" "math/big" ) func main() { i := new(big.Int) _, err := fmt.Sscan("18446744073709551617", i) if err != nil { log.Println("error scanning value:", err) } else { fmt.Println(i) } }
Output:
18446744073709551617