|
@@ -34,7 +34,6 @@ import com.owncloud.android.lib.common.utils.Log_OC;
|
|
|
|
|
|
import org.apache.commons.codec.binary.Hex;
|
|
|
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
import java.security.MessageDigest;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
import java.util.Locale;
|
|
@@ -269,10 +268,9 @@ public class BitmapUtils {
|
|
|
*
|
|
|
* @param name The name
|
|
|
* @return corresponding RGB color
|
|
|
- * @throws UnsupportedEncodingException if the charset is not supported
|
|
|
* @throws NoSuchAlgorithmException if the specified algorithm is not available
|
|
|
*/
|
|
|
- public static int[] calculateHSL(String name) throws UnsupportedEncodingException, NoSuchAlgorithmException {
|
|
|
+ public static int[] calculateHSL(String name) throws NoSuchAlgorithmException {
|
|
|
// using adapted algorithm from https://github.com/nextcloud/server/blob/master/core/js/placeholder.js#L126
|
|
|
|
|
|
String[] result = new String[]{"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"};
|
|
@@ -352,18 +350,11 @@ public class BitmapUtils {
|
|
|
return hsl;
|
|
|
}
|
|
|
|
|
|
- public static String md5(String string) {
|
|
|
- try {
|
|
|
- MessageDigest md5 = MessageDigest.getInstance("MD5");
|
|
|
- md5.update(string.getBytes());
|
|
|
-
|
|
|
- return new String(Hex.encodeHex(md5.digest()));
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- Log_OC.e(TAG, e.getMessage());
|
|
|
- }
|
|
|
+ public static String md5(String string) throws NoSuchAlgorithmException {
|
|
|
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
|
|
|
+ md5.update(string.getBytes());
|
|
|
|
|
|
- return "";
|
|
|
+ return new String(Hex.encodeHex(md5.digest()));
|
|
|
}
|
|
|
|
|
|
/**
|