Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Apr 30, 2019
1 parent c1b8965 commit bebee0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions libdevcore/IpfsHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ bytes dev::ipfsHash(string _data)

cout << toHex(blockData) << endl;
cout << toHex(blockData.size()) << endl;
cout << "Hash: " << toHex(picosha2::hash256(std::move(blockData))) << endl;
// Multihash: sha2-256, 256 bits
bytes hash = bytes{0x12, 0x20} + picosha2::hash256(std::move(blockData));
return hash;
Expand Down
3 changes: 2 additions & 1 deletion test/libdevcore/IpfsHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ BOOST_AUTO_TEST_CASE(test_small)
BOOST_AUTO_TEST_CASE(test_medium)
{
// 131000 works, 131071 does not.
size_t length = 131000;//131071;
// TODO it seems to be an error in the sha2 library, though.
size_t length = 131071;//131071;
string data;
data.resize(length, 0);
BOOST_REQUIRE_EQUAL(data.size(), length);
Expand Down

0 comments on commit bebee0c

Please sign in to comment.