This commit is contained in:
2024-09-16 17:36:12 +03:00
parent 46ae1a5872
commit 090e765a58
5 changed files with 11 additions and 6 deletions

View File

@ -11,7 +11,7 @@ TEST(hash, sha256)
TEST(hash, sha256_1e4)
{
std::vector<uint8_t> data(32);
for(uint64_t i = 0; i < 1e4; i++)
for (uint64_t i = 0; i < 1e4; i++)
{
sha256(data);
}

View File

@ -11,8 +11,8 @@ static const int8_t b58map[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1,
-1, 9, 10, 11, 12, 13, 14, 15, 16, -1, 17, 18, 19, 20, 21, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, -1, -1,
-1, 9, 10, 11, 12, 13, 14, 15, 16, -1, 17, 18, 19, 20, 21, -1,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1,
-1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, -1,
@ -24,6 +24,7 @@ static const int8_t b58map[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
//
};
TEST(baseN, isValid)

View File

@ -5,7 +5,7 @@ using namespace hex;
TEST(hex, encode)
{
std::vector<uint8_t> data = { 0x74, 0x65, 0x73, 0x74 };
std::vector<uint8_t> data = {0x74, 0x65, 0x73, 0x74};
EXPECT_EQ("74657374", encode(data));
}
TEST(hex, encode_1e6)
@ -15,7 +15,7 @@ TEST(hex, encode_1e6)
}
TEST(hex, decode)
{
std::vector<uint8_t> data = { 0x61, 0x6e, 0x6f };
std::vector<uint8_t> data = {0x61, 0x6e, 0x6f};
EXPECT_EQ(decode("616e6f"), data);
}
TEST(hex, decode_1e6)