Created
April 25, 2020 00:41
-
-
Save adeshmukh-quizlet/5215d21a5f48b9148e7c8c7d2d7912e4 to your computer and use it in GitHub Desktop.
kscript to generate base64 of md5 values
This file contains 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
#!/usr/bin/env kscript | |
import java.security.MessageDigest | |
import java.util.Base64 | |
val md5 = MessageDigest.getInstance("MD5") | |
println(args.map { Base64.getEncoder().encodeToString(md5.digest(it.toByteArray())) }.joinToString(" ")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisite
Install kscript
Then save the above script in your path (e.g.
~/bin/md5b64
) and make it executable.Sample usage
See also: bitrev