-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_sha1_file.cpp
37 lines (30 loc) · 890 Bytes
/
test_sha1_file.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
test_sha1_file.cpp - tests are intentionally split in two files.
The purpose of the split is to test linking of multiple files that include sha1.hpp.
============
SHA-1 in C++
============
100% Public Domain.
Original C Code
-- Steve Reid <[email protected]>
Small changes to fit into bglibs
-- Bruce Guenter <[email protected]>
Translation to simpler C++ Code
-- Volker Diels-Grabsch <[email protected]>
Header-only library
-- Zlatko Michailov <[email protected]>
*/
#include "sha1.hpp"
#include "sha1.hpp" // Intentionally included twice for testing purposes
#include <iostream>
#include <string>
using std::string;
using std::cout;
using std::endl;
/*
* Produce same output as "sha1sum -b"
*/
void test_file(const string &filename)
{
cout << SHA1::from_file(filename) << " *" << filename << endl;
}