BSX-21 Import Bitcoin Private Key from String

This commit is contained in:
Tzadik Vanderhoof 2014-02-24 00:47:00 -05:00
parent 63c6b2a02b
commit 57769e4df9
2 changed files with 2 additions and 0 deletions

View file

@ -11,6 +11,7 @@ class sha256
public:
sha256();
explicit sha256( const string& hex_str );
explicit sha256( const char *data );
string str()const;
operator string()const;

View file

@ -8,6 +8,7 @@
namespace fc {
sha256::sha256() { memset( _hash, 0, sizeof(_hash) ); }
sha256::sha256( const char *data ) { memcpy(_hash, data, sizeof(_hash) ); }
sha256::sha256( const string& hex_str ) {
fc::from_hex( hex_str, (char*)_hash, sizeof(_hash) );
}