Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public final class MessageDigest

  1. Object
  2. MessageDigest

A message digest over the platform’s own, which com.codename1.impl.JdkHost reaches: MD5, SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 in a Codename One application. Any algorithm the platform lacks is a NoSuchAlgorithmException, as it is on a JDK without a provider for it.

There are no providers here: getInstance with a provider argument, getProvider and a subclass of this class are not offered.

Methods

public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException
public void update(byte input)
public void update(byte[] input)
public void update(byte[] input, int offset, int len)
public byte[] digest()The digest of everything given so far; the next one starts empty.
public byte[] digest(byte[] input)
public void reset()
public String getAlgorithm()
public int getDigestLength()
public static boolean isEqual(byte[] a, byte[] b)Whether two digests are the same, in a time that does not depend on where they first differ.
public String toString()Returns a string representation of the object.

Inherited methods

Method details

getInstance

public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException

update

public void update(byte input)

update

public void update(byte[] input)

update

public void update(byte[] input, int offset, int len)

digest

public byte[] digest()
The digest of everything given so far; the next one starts empty.

digest

public byte[] digest(byte[] input)

reset

public void reset()

getAlgorithm

public String getAlgorithm()

getDigestLength

public int getDigestLength()

isEqual

public static boolean isEqual(byte[] a, byte[] b)
Whether two digests are the same, in a time that does not depend on where they first differ.

toString

public String toString()
Returns a string representation of the object. In general, the toString method returns a string that “textually represents” this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@’, and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + ‘@’ + Integer.toHexString(hashCode())