diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2025-10-19 00:09:53 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2025-10-19 00:24:21 +0200 |
| commit | f1b1880cf01a8abb6016954e51b46c453c3d6d94 (patch) | |
| tree | 815b035e5b03775f7e775196851bbebc137ebb2c /src/sha1_openssl.cc | |
| parent | 48bdfbeb03319eb21b5e73e69f525ba298af975c (diff) | |
sha1: Add new module
SHA1 hasher. Needed by websocket support that is coming soon.
Using either libmd or openssl to do the actual hashing.
Diffstat (limited to 'src/sha1_openssl.cc')
| -rw-r--r-- | src/sha1_openssl.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sha1_openssl.cc b/src/sha1_openssl.cc new file mode 100644 index 0000000..9e6d77e --- /dev/null +++ b/src/sha1_openssl.cc @@ -0,0 +1,13 @@ +#include "sha1.hh" + +#include <openssl/sha.h> + +namespace sha1 { + +std::array<uint8_t, 20> hash(std::span<uint8_t const> input) { + std::array<uint8_t, 20> ret; + SHA1(input.data(), input.size(), ret.data()); + return ret; +} + +} // namespace sha1 |
