diff --git a/CCEngine/src/SystemParamsModel.cpp b/CCEngine/src/SystemParamsModel.cpp index 5ba169f..89ee9cd 100644 --- a/CCEngine/src/SystemParamsModel.cpp +++ b/CCEngine/src/SystemParamsModel.cpp @@ -2,8 +2,10 @@ #include +#include #include #include + namespace { template< typename T > @@ -31,14 +33,14 @@ namespace { return (sum2 << std::numeric_limits::digits) | sum1; } - typedef std::string ParamHash; - ParamHash fletcher64(const std::string& input) - { - std::vector buf((input.size() + sizeof(uint32_t) - 1) / sizeof(uint32_t), 0); - std::copy_n(std::begin(input), input.size(), stdext::make_checked_array_iterator((std::string::pointer)buf.data(), buf.size() * sizeof(uint32_t))); - auto resInt = fletcher64(buf.data(), buf.size()); - return intToHex(resInt); - } + typedef std::string ParamHash; + ParamHash fletcher64(const std::string& input) + { + std::vector buf((input.size() + sizeof(uint32_t) - 1) / sizeof(uint32_t), 0); + std::memcpy((std::string::pointer)buf.data(), input.data(), input.size()); + auto resInt = ::fletcher64(buf.data(), static_cast(buf.size())); + return intToHex(resInt); + } }