diff --git a/coding/CMakeLists.txt b/coding/CMakeLists.txt index 4f34c3e..1c99408 100644 --- a/coding/CMakeLists.txt +++ b/coding/CMakeLists.txt @@ -60,8 +60,6 @@ set( reader_wrapper.hpp reader_writer_ops.cpp reader_writer_ops.hpp - sha1.cpp - sha1.hpp simple_dense_coding.cpp simple_dense_coding.hpp string_utf8_multilang.cpp diff --git a/coding/sha1.cpp b/coding/sha1.cpp deleted file mode 100644 index b437de8..0000000 --- a/coding/sha1.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "coding/sha1.hpp" - - -namespace coding -{ -// static -SHA1::Hash SHA1::Calculate(std::string const & /*filePath*/) -{ - return {}; -} - -// static -std::string SHA1::CalculateBase64(std::string const & /*filePath*/) -{ - return {}; -} - -// static -SHA1::Hash SHA1::CalculateForString(std::string const & /*str*/) -{ - return {}; -} - -// static -std::string SHA1::CalculateForStringFormatted(std::string const & /*str*/) -{ - return {}; -} - -// static -std::string SHA1::CalculateBase64ForString(std::string const & /*str*/) -{ - return {}; -} -} // coding diff --git a/coding/sha1.hpp b/coding/sha1.hpp deleted file mode 100644 index b37eac6..0000000 --- a/coding/sha1.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#pragma message("sha1.hpp is dummy header, delete it or suffer the warning") - -#include -#include - -namespace coding -{ -class SHA1 -{ -public: - static size_t constexpr kHashSizeInBytes = 20; - using Hash = std::array; - - static Hash Calculate(std::string const & filePath); - static std::string CalculateBase64(std::string const & filePath); - - static Hash CalculateForString(std::string const & str); - // String representation of 40-number hex digit. - static std::string CalculateForStringFormatted(std::string const & str); - static std::string CalculateBase64ForString(std::string const & str); -}; -} // coding diff --git a/platform/country_file.hpp b/platform/country_file.hpp index c1b575d..c077dcd 100644 --- a/platform/country_file.hpp +++ b/platform/country_file.hpp @@ -25,9 +25,6 @@ public: void SetRemoteSizes(MwmSize mapSize, MwmSize routingSize); MwmSize GetRemoteSize(MapOptions file) const; - void SetSha1(std::string const & base64Sha1) { m_sha1 = base64Sha1; } - std::string const & GetSha1() const { return m_sha1; } - inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; } inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; } inline bool operator!=(const CountryFile & rhs) const { return !(*this == rhs); } @@ -39,8 +36,6 @@ private: std::string m_name; MwmSize m_mapSize = 0; MwmSize m_routingSize = 0; - /// \note SHA1 is encoded to base64. - std::string m_sha1; }; /// \returns This method returns file name with extension. For example Abkhazia.mwm or diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp index 1c56b4b..8599e52 100644 --- a/platform/local_country_file.cpp +++ b/platform/local_country_file.cpp @@ -4,7 +4,6 @@ #include "platform/platform.hpp" #include "coding/internal/file_data.hpp" -#include "coding/sha1.hpp" #include "base/file_name_utils.hpp" #include "base/logging.hpp" @@ -109,13 +108,6 @@ bool LocalCountryFile::operator==(LocalCountryFile const & rhs) const m_version == rhs.m_version && m_files == rhs.m_files; } -bool LocalCountryFile::ValidateIntegrity() const -{ - auto calculatedSha1 = coding::SHA1::CalculateBase64(GetPath(MapOptions::Map)); - ASSERT_EQUAL(calculatedSha1, m_countryFile.GetSha1(), ("Integrity failure")); - return calculatedSha1 == m_countryFile.GetSha1(); -} - // static LocalCountryFile LocalCountryFile::MakeForTesting(string const & countryFileName, int64_t version) { diff --git a/platform/local_country_file.hpp b/platform/local_country_file.hpp index e290efd..e27add3 100644 --- a/platform/local_country_file.hpp +++ b/platform/local_country_file.hpp @@ -77,8 +77,6 @@ public: bool operator==(LocalCountryFile const & rhs) const; bool operator!=(LocalCountryFile const & rhs) const { return !(*this == rhs); } - bool ValidateIntegrity() const; - // Creates LocalCountryFile for test purposes, for a country region // with countryFileName (without any extensions). Automatically // performs sync with disk.