add: hex2uint64 util
This commit is contained in:
12
pkg/util/hex2int.go
Normal file
12
pkg/util/hex2int.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Hex2Int(hexStr string) uint64 {
|
||||
cleaned := strings.Replace(hexStr, "0x", "", -1)
|
||||
result, _ := strconv.ParseUint(cleaned, 16, 64)
|
||||
return uint64(result)
|
||||
}
|
||||
Reference in New Issue
Block a user