c - Equivalent of md5 hashing in linux commands -


i have following code in c

u_char buf[64] = "hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha"; //make md5 hash on buffer md5_init(&ctx); md5_update(&ctx, buf, sizeof(buf)); md5_final(buf, &ctx); 

md5_init, md5_update , md5_final openssl library.

the above code make md5 hash on buffer buf.

i want make same thing linux command using md5sum

$echo -n "hahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahaha" | md5sum 

but did not same result

what equivalent of md5 hashing in linux commands?

actually, md5sum equivalent.

echo prints out new-line character. try echo -n hahaha.... | md5sum.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -