Skip to content

Commit

Permalink
allow an argument to hash an arbitary value
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus committed May 10, 2014
1 parent a76076d commit e2bf794
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
#include <string.h>
#include "hash.h"

int main( void )
int main( int argc, char *argv[] )
{
char clear[6];
char clear[121];
char *hash;

strcpy(clear, "test");
if (argc < 2 || strlen(argv[1]) > 120)
{
strcpy(clear, "test");
}
else
{
strcpy(clear, argv[1]);
}

printf( "\nUsing word 'test' (without the quotes)\n" );
printf( "\nUsing word '%s' (without the quotes)\n", clear );

hash = mk_hash( clear, ALG_PHPMD5 );
printf( "\nphp_md5 -> %s", hash);
Expand Down

0 comments on commit e2bf794

Please sign in to comment.