esempio che usa l'implementazioe che ho io dell'md5 (C++)
codice:#include <stdio.h> #include "md5.h" int main( int argc, char **argv ) { md5 hash; char buff[4096]; unsigned char md5_hash[16]; int ret; hash.init(); FILE *file = fopen(argv[1],"r"); if( file == NULL ) return -1; do { ret = fread(buff,4096,1,file); if( ret == -1 ) return -1; hash.add( buff, ret ); } while( ret == 4096 ); hash.get(md5_hash); printf("%s -> %s\n",argv[1],md5_hash); fclose(file); }