lchash.h 428 B

123456789101112131415161718
  1. #pragma once
  2. #include "lciter.h"
  3. #include <util/digest/fnv.h>
  4. #include <util/generic/strbuf.h>
  5. template <class T>
  6. static inline T FnvCaseLess(const char* b, size_t l, T t = 0) noexcept {
  7. using TIter = TLowerCaseIterator<const char>;
  8. return FnvHash(TIter(b), TIter(b + l), t);
  9. }
  10. template <class T>
  11. static inline T FnvCaseLess(const TStringBuf& s, T t = 0) noexcept {
  12. return FnvCaseLess(s.data(), s.size(), t);
  13. }