From 28dd60c619aaa9c5e4100779f60e6e11864900cb Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 21 Jan 2026 22:42:25 +0100 Subject: feat: add wchar_t operator for crc-hash. Signed-off-by: Amlal El Mahrouss --- include/ocl/crc_hash.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/ocl/crc_hash.hpp b/include/ocl/crc_hash.hpp index 8775e79..412ec63 100644 --- a/include/ocl/crc_hash.hpp +++ b/include/ocl/crc_hash.hpp @@ -56,13 +56,13 @@ namespace ocl 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; - template - static constexpr algorithm crc(const char* in, std::size_t len) + template + static constexpr Algorithm crc(const Ch* in, std::size_t len) { if (!len) return 0UL; - algorithm crc = 0xffffffff; + Algorithm crc = 0xffffffff; std::size_t cnt = 0; while ((len--) > 0) @@ -95,6 +95,12 @@ operator""_crc32(const char* in, std::size_t len) noexcept return ocl::crc_hash_trait::crc(static_cast(in), len); } +inline std::uint32_t +operator""_crc32(const wchar_t* in, std::size_t len) noexcept +{ + return ocl::crc_hash_trait::crc(static_cast(in), len); +} + namespace std { template <> -- cgit v1.2.3