Răsfoiți Sursa

*** empty log message ***

Mike Goslin 25 ani în urmă
părinte
comite
1f4c504b42

+ 0 - 0
panda/src/downloadertools/Makefile.check_md5


+ 10 - 0
panda/src/downloadertools/Sources.pp

@@ -41,6 +41,16 @@
 
 #end bin_target
 
+#begin bin_target
+  #define TARGET check_md5
+  #define TARGET_IF_CRYPTO yes
+  #define USE_CRYPTO yes
+
+  #define SOURCES \
+    check_md5.cxx
+
+#end bin_target
+
 #begin bin_target
   #define TARGET multify
 

+ 17 - 0
panda/src/downloadertools/check_md5.cxx

@@ -0,0 +1,17 @@
+#include <crypto_utils.h>
+
+int 
+main(int argc, char *argv[]) {
+  if (argc < 2) {
+    cerr << "Usage: check_md5 <file>" << endl;
+    return 0;
+  }
+
+  Filename source_file = argv[1];
+
+  HashVal hash;
+  md5_a_file(source_file, hash);
+  cout << hash << endl;
+
+  return 1;
+}