Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6193581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:08:38+00:00 2026-05-24T03:08:38+00:00

Testing the Javascript Implementation of MD5 here: http://www.webtoolkit.info/javascript-md5.html gives the following output: MD5(muzaaya) =

  • 0

Testing the Javascript Implementation of MD5 here: http://www.webtoolkit.info/javascript-md5.html gives the following output:

MD5("muzaaya") = "00e081abefbbbf72b2d5258196a9b6d0"

Going to my erlang shell, and calculating the MD5 of the same value i get this:

Eshell V5.8.4  (abort with ^G)
1> erlang:md5("muzaaya").
<<0,224,129,171,239,187,191,114,178,213,37,129,150,169,
  182,208>>
2>

How can i compare the two? If the MD5 result from the JavaScript front end app comes to my Erlang backend, i would like to be able to compare the two Digests. How can i match the Javascript MD5 digest to that of Erlang?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:08:39+00:00Added an answer on May 24, 2026 at 3:08 am

    An MD5 hash is in essence a 128-bit number.

    You receive the MD5 value in Erlang as a binary of 16 bytes (16 * 8 = 128 bits). Each byte in that binary has to be converted into hexadecimal representation to be comparable to JavaScript’s MD5 output (which is a hexadecimal string with two characters per byte):

    2> lists:flatten([io_lib:format("~2.16.0b", [B]) || <<B>> <= MD5]).
    "00e081abefbbbf72b2d5258196a9b6d0"
    

    First, we take each byte from the binary and use the io_lib module to format it to a hexadecimal string. Then we use the flatten function to display it as a readable string (although this isn’t necessary if you’re going to write the value to a file or a socket since they are able to handle deep io lists, nested lists of characters or binaries).

    The format string used, ~2.16.0b means format an integer (b) using base 16 and padding to width 2 with the padding character 0 (see io:format/3 for a full guide).

    If you want a binary, you could use the following binary comprehension instead:

    3> << << (list_to_binary(io_lib:format("~2.16.0b", [C])))/binary >>
         || <<C>> <= MD5 >>.
    <<"00e081abefbbbf72b2d5258196a9b6d0">>
    

    (Instead of io_lib:format/2 there is also http_util:integer_to_hexlist/1, although I don’t know if it is faster)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While testing JavaScript code in Firefox 3.5 I sometimes get the following error: Component
I'm trying to get better at unit testing my JavaScript. I have the following
I'm hoping someone can help me out here - I'm testing some javascript and
Demo page for testing : http://jsfiddle.net/rCKzs/ <script type=text/javascript> $(document).ready(function() { alert( $(#test).width() ); });
what do you prefer for testing JavaScript apps using Cucumber? I never did it
Hi Can somebody fill me in on JavaScript Testing Frameworks? I'm working on a
For Javascript some testing-frameworks exist, like JSUnit or js-test-driver. They are fine, but they
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
I'm looking at using the Dojo Objective Harness (DOH) for testing some custom JavaScript
For debugging and testing I'm searching for a JavaScript shell with auto completion and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.