Last active
October 16, 2019 15:52
-
-
Save miguelmota/a484b396fc15f5951f86f481bc6d1e2d to your computer and use it in GitHub Desktop.
EOS C++ SHA256 hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <eosiolib/eosio.hpp> | |
#include <eosiolib/print.hpp> | |
#include <eosiolib/crypto.h> | |
using namespace eosio; | |
std::string data = "hello"; | |
checksum256 digest; | |
sha256(&data[0], data.size(), &digest); | |
printhex(&digest, sizeof(digest)); // 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment