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

  • Home
  • SEARCH
  • 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 6700169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:46:56+00:00 2026-05-26T06:46:56+00:00

In http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml an example is given how to calculate an MD5 hash of String.

  • 0

In http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml an example is given how to calculate an MD5 hash of String. This results in a 20 digit hex string. According to http://en.wikipedia.org/wiki/MD5 I would expect a 32 digit hex string. I get the same result for example using dac2009 response in How can I generate an MD5 hash?.

Why do I get something which looks like a MD5 hash but isn’t? I cannot imagine that all the strings I get I have to pad with 12 leading zeros.

Edit: one code example

public static String MungPass(String pass) throws NoSuchAlgorithmException {
    MessageDigest m = MessageDigest.getInstance("MD5");
    byte[] data = pass.getBytes(); 
    m.update(data,0,data.length);
    BigInteger i = new BigInteger(1,m.digest());
    return String.format("%1$032X", i);
}

Taken from http://snippets.dzone.com/posts/show/3686

  • 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-26T06:46:56+00:00Added an answer on May 26, 2026 at 6:46 am

    You must be missing something. The linked code is just fine. Make sure the issue is nowhere else, related to displaying the result. Possibilities:

    • in a GUI too small
    • in a console with multithreading issues
    • over a network package which is being cut off to soon
    • you cut the length to 20 instead of 0x20, which is 32.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://www.validome.org/xml/validate/?lang=en&viewSourceCode=1&url=http://45143.com/finance-feed/abc.xml&onlyWellFormed=1 check the url above for validator results. Line 171 in the XSD is
http://www.example.com/http://www.test.com I have tried many different methods using .htaccess with no luck. I need
http://www.kampyle.com/ in this url when you scroll one picture always moves. I want to
http://www.kampyle.com/software-feedback-analytics On this url clicking on image it's become popup, clicking on popup image
http://www.globalguideline.com/interview_questions/Questions.php?sc=C_Sharp_Programming_Language_Interview_Questions_A&page=6 In this URL, a user sees on the left side a Twitter picture
http://www.ika-world.com/search.php?view=weltkarte See link for example. Image is a PHP created PNG image. When viewing
http://www.twofivefivefive.com/asctest/ I am helping a friend with this site, and it is a fluid,
http://www.radikalgenc.com/bulten/ekim.htm this is a monthly newsletter. but it does not appear fine on mozilla,
http://www.research.att.com/~njas/sequences/A097196 I was wondering how to continue generating the sequence given in the link.
http://www.ibm.com/developerworks/library/j-ajax1/ajax.gif I came across this flow, i would like to know certain things over

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.