Android Open Source - android-ribbit-design M D5 Util






From Project

Back to project page android-ribbit-design.

License

The source code is released under:

MIT License

If you think the Android project android-ribbit-design listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.teamtreehouse.ribbit.utils;
/* w w w.  j a va  2 s  .  c  o m*/
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5Util {
  public static String hex(byte[] array) {
      StringBuffer sb = new StringBuffer();
      for (int i = 0; i < array.length; ++i) {
      sb.append(Integer.toHexString((array[i]
          & 0xFF) | 0x100).substring(1,3));        
      }
      return sb.toString();
  }
  public static String md5Hex (String message) {
      try {
      MessageDigest md = 
          MessageDigest.getInstance("MD5");
      return hex (md.digest(message.getBytes("CP1252")));
      } catch (NoSuchAlgorithmException e) {
      } catch (UnsupportedEncodingException e) {
      }
      return null;
  }
}




Java Source Code List

com.teamtreehouse.ribbit.RibbitApplication.java
com.teamtreehouse.ribbit.adapters.MessageAdapter.java
com.teamtreehouse.ribbit.adapters.SectionsPagerAdapter.java
com.teamtreehouse.ribbit.adapters.UserAdapter.java
com.teamtreehouse.ribbit.ui.EditFriendsActivity.java
com.teamtreehouse.ribbit.ui.FriendsFragment.java
com.teamtreehouse.ribbit.ui.InboxFragment.java
com.teamtreehouse.ribbit.ui.LoginActivity.java
com.teamtreehouse.ribbit.ui.MainActivity.java
com.teamtreehouse.ribbit.ui.RecipientsActivity.java
com.teamtreehouse.ribbit.ui.SignUpActivity.java
com.teamtreehouse.ribbit.ui.ViewImageActivity.java
com.teamtreehouse.ribbit.utils.FileHelper.java
com.teamtreehouse.ribbit.utils.ImageResizer.java
com.teamtreehouse.ribbit.utils.MD5Util.java
com.teamtreehouse.ribbit.utils.ParseConstants.java