pull/43/head
kunfei 5 years ago
parent 547972e039
commit 3e224749ca
  1. 8
      app/src/main/java/io/legado/app/help/JsExtensions.kt
  2. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  3. 6
      app/src/main/java/io/legado/app/utils/MD5Utils.kt

@ -38,12 +38,12 @@ object JsExtensions {
return EncoderUtils.base64Encode(str, flags)
}
fun strToMd5By32(str: String): String? {
return MD5Utils.strToMd5By32(str)
fun md5Encode(str: String): String? {
return MD5Utils.md5Encode(str)
}
fun strToMd5By16(str: String): String? {
return MD5Utils.strToMd5By16(str)
fun md5Encode16(str: String): String? {
return MD5Utils.md5Encode16(str)
}
}

@ -584,12 +584,12 @@ class AnalyzeRule(private var book: BaseBook? = null) {
return EncoderUtils.base64Encode(str, flags)
}
fun strToMd5By32(str: String): String? {
return MD5Utils.strToMd5By32(str)
fun md5Encode(str: String): String? {
return MD5Utils.md5Encode(str)
}
fun strToMd5By16(str: String): String? {
return MD5Utils.strToMd5By16(str)
fun md5Encode16(str: String): String? {
return MD5Utils.md5Encode16(str)
}
/**

@ -9,7 +9,7 @@ import java.security.NoSuchAlgorithmException
object MD5Utils {
fun strToMd5By32(str: String?): String? {
fun md5Encode(str: String?): String? {
if (str == null) return null
var reStr: String? = null
try {
@ -31,8 +31,8 @@ object MD5Utils {
return reStr
}
fun strToMd5By16(str: String): String? {
var reStr = strToMd5By32(str)
fun md5Encode16(str: String): String? {
var reStr = md5Encode(str)
if (reStr != null) {
reStr = reStr.substring(8, 24)
}

Loading…
Cancel
Save