|
@@ -58,19 +58,20 @@ class Utils {
|
|
|
|
|
|
fun customSaltKey(userinfo: UserInfo) : String {
|
|
|
val id = userinfo.id
|
|
|
- val email = userinfo.email
|
|
|
- val saltKey = "${id}_${email}_${id}"
|
|
|
- val filterSaltKey = saltKey.replace("[@.]".toRegex(), "")
|
|
|
- val encodedSaltKey = Base64.encodeToString(filterSaltKey.toByteArray(Charsets.UTF_8), Base64.DEFAULT)
|
|
|
- val salt16Length = encodedSaltKey.take(16)
|
|
|
- return salt16Length
|
|
|
+// val email = userinfo.email
|
|
|
+// val saltKey = "${id}_${email}_${id}"
|
|
|
+// val filterSaltKey = saltKey.replace("[@.]".toRegex(), "")
|
|
|
+// val encodedSaltKey = Base64.encodeToString(filterSaltKey.toByteArray(Charsets.UTF_8), Base64.DEFAULT)
|
|
|
+// val salt16Length = encodedSaltKey.take(16)
|
|
|
+
|
|
|
+ val saltKey = id.toString().repeat(16).takeLast(16)
|
|
|
+ return saltKey
|
|
|
}
|
|
|
|
|
|
- fun customPassword(password: String) : String {
|
|
|
- val reversedPassword = "$password${password.reversed()}"
|
|
|
- val encodedPassword = Base64.encodeToString(reversedPassword.toByteArray(Charsets.UTF_8), Base64.DEFAULT)
|
|
|
- val password16Length = encodedPassword.take(16)
|
|
|
- return password16Length
|
|
|
+ fun customSecretKey(userinfo: UserInfo) : String {
|
|
|
+ val id = userinfo.id
|
|
|
+ val secretKey = id.toString().repeat(16).take(16)
|
|
|
+ return secretKey
|
|
|
}
|
|
|
}
|
|
|
}
|