Skip to content

imahjoub/hash_sha1

Repository files navigation

hash_sha1

Build Status Issues CodeQL Codacy Badge Quality Gate Status code coverage Boost Software License 1.0

A simple implementation of SHA-1 in C++ (header-only). This implementation uses little endian byte order.

Using the hash_sha1

  • 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, continuous integration and quality

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.

References

Algorithm specification can be found here:

About

C++ implementation of SHA-1 (header-only)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages