MCPcopy Create free account
hub / github.com/FastLED/FastLED / hash_string_view

Function hash_string_view

src/fl/stl/string_view.h:463–471  ·  view source on GitHub ↗

======= OUTPUT HELPER ======= Inline hash function for string_view

Source from the content-addressed store, hash-verified

461// ======= OUTPUT HELPER =======
462// Inline hash function for string_view
463inline u32 hash_string_view(string_view sv) FL_NOEXCEPT {
464 // FNV-1a 32-bit hash algorithm
465 u32 hash = 2166136261u;
466 for (fl::size i = 0; i < sv.size(); ++i) {
467 hash ^= static_cast<u32>(sv[i]);
468 hash *= 16777619u;
469 }
470 return hash;
471}
472
473} // namespace fl

Callers 1

FL_TEST_FILEFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected