func isValidHex()

in src/local_gpu_verifier_http_service/cmd/local_gpu_verifier_http_service/main.go [261:273]


func isValidHex(s string, numBytes int) bool {
	// Check string length should be twice the number of bytes
	if len(s) != numBytes*2 {
		return false
	}
	// Try decoding the hex string
	decoded, err := hex.DecodeString(s)
	if err != nil {
		return false
	}
	// Ensure the decoded byte slice has the expected length
	return len(decoded) == numBytes
}