7 #include <openssl/sha.h>
9 #include <glog/logging.h>
11 #include <cppcodec/base32_crockford.hpp>
15 Hash() { CHECK_EQ(SHA256_Init(&c
), 1); }
17 void update(std::string_view s
)
19 CHECK_EQ(SHA256_Update(&c
, s
.data(), s
.length()), 1);
24 unsigned char md
[SHA256_DIGEST_LENGTH
];
25 CHECK_EQ(SHA256_Final(md
, &c
), 1);
26 return cppcodec::base32_crockford::encode(md
);
33 #endif // HASH_DOT_HPP