MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / HexStringToUint64

Function HexStringToUint64

tensorflow/core/lib/strings/numbers.cc:414–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414bool HexStringToUint64(const StringPiece& s, uint64* result) {
415 uint64 v = 0;
416 if (s.empty()) {
417 return false;
418 }
419 for (size_t i = 0; i < s.size(); i++) {
420 char c = s[i];
421 if (c >= '0' && c <= '9') {
422 v = (v << 4) + (c - '0');
423 } else if (c >= 'a' && c <= 'f') {
424 v = (v << 4) + 10 + (c - 'a');
425 } else if (c >= 'A' && c <= 'F') {
426 v = (v << 4) + 10 + (c - 'A');
427 } else {
428 return false;
429 }
430 }
431 *result = v;
432 return true;
433}
434
435string HumanReadableNum(int64 value) {
436 string s;

Callers 2

ParseKeyMethod · 0.85
TESTFunction · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68