User Tools

Site Tools


java:createmd5hashinjavawithspring

This is an old revision of the document!


Create a md5 hash in java with eclipse

Spring does have a not-well-known utility called DigestUtils who allows you to create md5 hashes easily. Here is an example:

import org.springframework.util.DigestUtils;

public class Example
{

public static void main( String[] args )
{
  System.out.println(  DigestUtils.md5DigestAsHex( "Hello world".getBytes() )  );
} // main

}
java/createmd5hashinjavawithspring.1369214787.txt.gz · Last modified: 2022/12/02 22:02 (external edit)