1
0
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-11-17 00:22:32 +01:00

Fixed non-thread safe usage

This commit is contained in:
carbotaniuman 2021-01-26 14:02:58 -06:00
parent d410e5ec17
commit b391d730fa

View File

@ -20,10 +20,9 @@ package mdnet.server
import java.security.MessageDigest import java.security.MessageDigest
private val DIGEST = MessageDigest.getInstance("MD5") fun md5Bytes(stringToHash: String) =
fun md5Bytes(stringToHash: String): ByteArray { MessageDigest.getInstance("MD5")
return DIGEST.digest(stringToHash.toByteArray()) .digest(stringToHash.toByteArray())
}
fun printHexString(bytes: ByteArray): String { fun printHexString(bytes: ByteArray): String {
val sb = StringBuilder() val sb = StringBuilder()