FastLED 3.10.9
Loading...
Searching...
No Matches

◆ read_hex4()

long fl::anonymous_namespace{json.cpp.hpp}::read_hex4 ( const fl::span< const char > & span,
size_t pos )

Definition at line 642 of file json.cpp.hpp.

642 {
643 if (pos + 4 > span.size()) return -1;
644 long value = 0;
645 for (size_t k = 0; k < 4; ++k) {
646 char h = span[pos + k];
647 int digit;
648 if (h >= '0' && h <= '9') digit = h - '0';
649 else if (h >= 'a' && h <= 'f') digit = h - 'a' + 10;
650 else if (h >= 'A' && h <= 'F') digit = h - 'A' + 10;
651 else return -1;
652 value = (value << 4) | digit;
653 }
654 return value;
655}
uint8_t pos
Definition Blur.ino:11
constexpr fl::size size() const FL_NO_EXCEPT
Definition span.h:483
constexpr int type_rank< T >::value

References fl::FL_NO_EXCEPT, pos, read_hex4(), fl::span< T, Extent >::size(), and fl::type_rank< T >::value.

Referenced by read_hex4(), and unescape_string().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: