blob: d0c9d2027d420bc63417154d4e9c62482daa5df4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "common.hh"
#include "hash_method.hh"
#include <gtest/gtest.h>
TEST(hash_method, sha256) {
auto hash = HashMethod::sha256();
EXPECT_EQ("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
hash->finish());
hash->update("foobar", 6);
EXPECT_EQ("c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2",
hash->finish());
hash->update("foo", 3);
EXPECT_EQ("2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
hash->finish());
}
|