Package javaforce

Class MD5

java.lang.Object
javaforce.MD5

public class MD5 extends Object
In cryptography, MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-bit hash value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MD5()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] input, int inputOffset, int inputLen)
    MD5 block add operation.
    void
    add(String str)
    Adds a string.
    char[]
    byte2char(byte[] b)
    Converts binary output of done() to 64 chars
    byte[]
    MD5 finalization.
    void
    MD5 initialization.
    Finalize MD5 and return as a string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MD5

      public MD5()
  • Method Details

    • init

      public void init()
      MD5 initialization. Begins an MD5 operation.
    • add

      public void add(byte[] input, int inputOffset, int inputLen)
      MD5 block add operation. Continues an MD5 message-digest operation, processing another message block, and updating the context.
    • add

      public void add(String str)
      Adds a string.
    • done

      public byte[] done()
      MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context.
    • toString

      public String toString()
      Finalize MD5 and return as a string.
      Overrides:
      toString in class Object
    • byte2char

      public char[] byte2char(byte[] b)
      Converts binary output of done() to 64 chars