RIPEMD-160 is another hash function; it computes a 160-bit message digest.

There is a RIPEMD-160 home page, with test vectors and pseudocode for RIPEMD-160.
For padding the message, RIPEMD-160 acts like MD4 (RFC 1320).

Find the RIPEMD-160 message digest of a string of octets.
Use the ASCII encoded string “Rosetta Code”.
You may either call an RIPEMD-160 library, or implement RIPEMD-160 in your language.

import org.bouncycastle.crypto.digests.RIPEMD160Digest
import org.bouncycastle.util.encoders.Hex
import kotlin.text.Charsets.US_ASCII
 
fun RIPEMD160Digest.inOneGo(input : ByteArray) : ByteArray {
    val output = ByteArray(digestSize)
 
    update(input, 0, input.size)
    doFinal(output, 0)
 
    return output
}
 
fun main(args: Array<String>) {
    val input = "Rosetta Code".toByteArray(US_ASCII)
    val output = RIPEMD160Digest().inOneGo(input)
 
    Hex.encode(output, System.out)
    System.out.flush()
}