Downloading extensions from Github Repo. (#1101)

Downloading extensions from Github Repo.
This commit is contained in:
Carlos
2018-02-05 16:50:56 -05:00
committed by inorichi
parent a71c805959
commit 854112095b
46 changed files with 2319 additions and 615 deletions
@@ -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 {