Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active October 16, 2019 15:52
Show Gist options
  • Save miguelmota/a484b396fc15f5951f86f481bc6d1e2d to your computer and use it in GitHub Desktop.
Save miguelmota/a484b396fc15f5951f86f481bc6d1e2d to your computer and use it in GitHub Desktop.
EOS C++ SHA256 hash
#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