Downloading extensions from Github Repo. (#1101)
Downloading extensions from Github Repo.
This commit is contained in:
@@ -10,8 +10,6 @@ import android.support.v4.os.EnvironmentCompat
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import java.net.URLConnection
|
||||
import java.security.MessageDigest
|
||||
import java.security.NoSuchAlgorithmException
|
||||
|
||||
object DiskUtil {
|
||||
|
||||
@@ -52,16 +50,7 @@ object DiskUtil {
|
||||
}
|
||||
|
||||
fun hashKeyForDisk(key: String): String {
|
||||
return try {
|
||||
val bytes = MessageDigest.getInstance("MD5").digest(key.toByteArray())
|
||||
val sb = StringBuilder()
|
||||
bytes.forEach { byte ->
|
||||
sb.append(Integer.toHexString(byte.toInt() and 0xFF or 0x100).substring(1, 3))
|
||||
}
|
||||
sb.toString()
|
||||
} catch (e: NoSuchAlgorithmException) {
|
||||
key.hashCode().toString()
|
||||
}
|
||||
return Hash.md5(key)
|
||||
}
|
||||
|
||||
fun getDirectorySize(f: File): Long {
|
||||
|
||||
Reference in New Issue
Block a user