MD5 16 octet - how to compute?

S

Shuaib Zahda

Hi there

I am trying to compute the 16 octet MD5 hash.
I looked in the digest/md5 and i could not figure it out.
i used Digest::MD5.hexdigest(value)
but this computes 32 if I am not mistaken.

Any idea please?
 
M

Michael Fellinger

Hi there

I am trying to compute the 16 octet MD5 hash.
I looked in the digest/md5 and i could not figure it out.
i used Digest::MD5.hexdigest(value)
but this computes 32 if I am not mistaken.

Any idea please?

MD5 computes a 128bit hash.
If you use MD5.hexdigest, you will get a String representation in base
16, so it's 32 octets.
You could use MD5.digest instead, which returns a String in base 255,
that means it's 16 octets.
 
S

Shuaib Zahda

Michael said:
MD5 computes a 128bit hash.
If you use MD5.hexdigest, you will get a String representation in base
16, so it's 32 octets.
You could use MD5.digest instead, which returns a String in base 255,
that means it's 16 octets.

Michael thank you very much, you saved me a lot of time. It took me
hours to find this out and now my application is working

thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

md5 function in Ruby 13
How to md5 a string? 6
Base64 and MD5 fun 2
md5 hashses 1
How to get an MD5 Base64 hash? 2
MD5 Hash 6
Matching Java md5 digests 7
how to decrypt, after encrypting using digest/sha1 2

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top