diff options
Diffstat (limited to 'nacl/tests/hash4.cpp')
-rw-r--r-- | nacl/tests/hash4.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nacl/tests/hash4.cpp b/nacl/tests/hash4.cpp new file mode 100644 index 00000000..1d0a3f37 --- /dev/null +++ b/nacl/tests/hash4.cpp | |||
@@ -0,0 +1,18 @@ | |||
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 | |||
8 | int main() | ||
9 | { | ||
10 | string x = "testing\n"; | ||
11 | string h = crypto_hash_sha512(x); | ||
12 | for (int i = 0;i < h.size();++i) { | ||
13 | cout << hex << (15 & (int) (h[i] >> 4)); | ||
14 | cout << hex << (15 & (int) h[i]); | ||
15 | } | ||
16 | cout << "\n"; | ||
17 | return 0; | ||
18 | } | ||