I'm trying to generate MD5 of a string in my android code using kotlin..
val md5 = MessageDigest.getInstance("MD5")
val hash = md5.digest(queryToSign.toByteArray(Charset.defaultCharset())).toString()
But this gives me:
[B@118072
Any thoughts?
Solved it.. Use BigInteger
val md5 = MessageDigest.getInstance("MD5")
val hash = BigInteger(1, md5.digest(queryToSign.toByteArray(Charset.defaultCharset()))).toString(16)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.