28 namespace graphene {
namespace utilities {
32 const size_t size_of_data_to_hash =
sizeof(secret) + 1;
33 const size_t size_of_hash_bytes = 4;
34 char data[size_of_data_to_hash + size_of_hash_bytes];
36 memcpy(&data[1], (
char*)&secret,
sizeof(secret));
39 memcpy(data + size_of_data_to_hash, (
char*)&
digest, size_of_hash_bytes);
49 std::vector<char> wif_bytes;
54 catch (
const fc::parse_error_exception&)
58 if (wif_bytes.size() < 5)
60 std::vector<char> key_bytes(wif_bytes.begin() + 1, wif_bytes.end() - 4);
65 if( memcmp( (
char*)&check, wif_bytes.data() + wif_bytes.size() - 4, 4 ) == 0 ||
66 memcmp( (
char*)&check2, wif_bytes.
data() + wif_bytes.size() - 4, 4 ) == 0 )