lint
This commit is contained in:
3
include/libbase
Normal file
3
include/libbase
Normal file
@ -0,0 +1,3 @@
|
||||
#include <base/hex.hpp>
|
||||
#include <base/baseN.hpp>
|
||||
#include <base/hash/sha256.hpp>
|
||||
@ -22,6 +22,7 @@ static const int8_t hexmap[] = {
|
||||
-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,
|
||||
//
|
||||
};
|
||||
|
||||
namespace hex
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user