1
0
Fork 1
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-01-19 02:48:37 +00: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()