Created
October 29, 2018 03:23
-
-
Save k5trismegistus/c2dfc9d8a30df768d8ca21907dac9630 to your computer and use it in GitHub Desktop.
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 <stdio.h> | |
#include <string> | |
#include <eosiolib/eosio.hpp> | |
#include <eosiolib/crypto.h> | |
using namespace eosio; | |
class Hashtest : public contract { | |
public: | |
// constructor | |
Hashtest(account_name s):contract(s) | |
{} | |
//@abi action | |
void version() | |
{ | |
print("0.0.1"); | |
} | |
//@abi action | |
void hash(std::string s) | |
{ | |
// variable to get result from hashing all players hashes and secrets | |
checksum256 result; | |
// hash the contents in memory, starting at game.player1 and spanning for | |
// sizeof(player)*2 bytes | |
sha256( (char *)&s, 8, &result); | |
} | |
}; | |
EOSIO_ABI(Hashtest, (version)(hash)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment