A simple implementation of SHA-1 in C++ (header-only). This implementation uses little endian byte order.
- The following program shows a test example
// Create an object of hash_sha1
hash_sha1 hash;
// Original message
const std::array<std::uint8_t, 3U> msg = {'a', 'b', 'c' };
// Initialize hash
hash.sha1_init();
// Update the hash with given data
hash.sha1_update(msg.data(), msg.size());
// Get hash result
sha1_output_type hash_result = hash.sha1_final();
Testing and continuous integration runs on GitHub Actions. Various OS/compiler combinations are used including GCC/clang/MSVC.
Code coverage uses GCC/gcov/lcov and has a quality-gate with comparison/baseline-check provided by third-party Codecov.
Additional quality checks are performed on pull-request and merge to master using modern third party open-source services. These include CodeSonar and Codacy.
Algorithm specification can be found here: