Search code examples
encryptioncodenameonemessage-digest

Package in java 's equivalent in codenameone


i have a java api that uses those packages:

  • import java.security.MessageDigest;
  • import java.security.SecureRandom;
  • import java.util.Base64;

i find the equivalence of:

  • the second(import javabc.SecureRandom;)

    and

  • the third(import com.codename1.util.Base64;)

now i still searching for the equivalente of the first one(MessageDigest) Thanks


Solution

  • MessageDigest just loads the explicit algorithm dynamically. This sounds good for decoupling of encryption but due to dynamic loading it blocks the optimizer from generating efficient code. If we'd support it we'd need to include all of the possible message digests.

    The solution is to create an explicit digest instance such as SHA512Digest etc.