1
0

hash4.cpp 352 B

123456789101112131415161718
  1. #include <iostream>
  2. #include <string>
  3. using std::string;
  4. using std::cout;
  5. using std::hex;
  6. #include "crypto_hash_sha512.h"
  7. int main()
  8. {
  9. string x = "testing\n";
  10. string h = crypto_hash_sha512(x);
  11. for (int i = 0;i < h.size();++i) {
  12. cout << hex << (15 & (int) (h[i] >> 4));
  13. cout << hex << (15 & (int) h[i]);
  14. }
  15. cout << "\n";
  16. return 0;
  17. }