Last active
September 18, 2019 12:52
-
-
Save CanerPatir/f371568c393fd78a708d7707db63e832 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main(){ | |
| launch(Dispatchers.IO) { | |
| val user = api.fetchUserInfoAsync(id).await() | |
| withContext(Dispatchers.Default) { | |
| val hash = user.username.hash() | |
| } | |
| } | |
| } | |
| fun String.md5(): String { | |
| val md = MessageDigest.getInstance("MD5") | |
| return BigInteger(1, md.digest(toByteArray())).toString(16).padStart(32, '0') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment