Browse Source

- added string_of_algorithm()

master
Andreas Romeyke 2 years ago
parent
commit
8995e8fabf
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/lib/checksum.cpp

+ 8
- 0
src/lib/checksum.cpp View File

@ -6,6 +6,14 @@
#include "checksum.hpp"
string string_of_algorithm( checksum_algorithms alg) {
switch( alg ) {
case md5: return string("md5");
case sha1: return string("sha1");
case sha256: return string("sha256");
}
}
string Checksum::checksum_of_file(string filepath, checksum_algorithms alg) {
ifstream file (filepath, ios::ate);
stringstream hex_result;


Loading…
Cancel
Save