1 #include <iostream>
2 #include "../picosha2.h"
3 
main(int argc,char * argv[])4 int main(int argc, char* argv[])
5 {
6 	std::cout << "Input freely. To get hash, input \"hash!\". " << std::endl;
7 	picosha2::hash256_one_by_one hasher;
8 	while(true){
9 		hasher.init(); //reset hasher state
10 		while(true){
11 			std::string line;
12 			std::getline(std::cin, line);
13 			if(line == "hash!"){
14 				break;
15 			}
16 			hasher.process(line.begin(), line.end());
17 		}
18 		hasher.finish();
19 		std::string hex_str;
20 		picosha2::get_hash_hex_string(hasher, hex_str);
21 		std::cout << hex_str << std::endl;
22 	}
23 
24     return 0;
25 }
26 
27