Add cell debug page.
This makes it much easier to troubleshoot information related to a cell by showing detailed data about a single cell. At this point much is a placeholder, but we at least get the cell boundary coordinates and a map. This also starts to make some code common around doing things like mapping.
This commit is contained in:
parent
7c2d7eef25
commit
c0b527c9a3
9 changed files with 465 additions and 48 deletions
34
strings.go
Normal file
34
strings.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func HexToInt64(hexStr string) (int64, error) {
|
||||
// Remove "0x" prefix if present
|
||||
hexStr = strings.TrimPrefix(hexStr, "0x")
|
||||
hexStr = strings.TrimPrefix(hexStr, "0X")
|
||||
|
||||
// Parse hex string to uint64
|
||||
value, err := strconv.ParseInt(hexStr, 16, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return value, nil
|
||||
}
|
||||
|
||||
func HexToUint64(hexStr string) (uint64, error) {
|
||||
// Remove "0x" prefix if present
|
||||
hexStr = strings.TrimPrefix(hexStr, "0x")
|
||||
hexStr = strings.TrimPrefix(hexStr, "0X")
|
||||
|
||||
// Parse hex string to uint64
|
||||
value, err := strconv.ParseUint(hexStr, 16, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return value, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue