Skip to content

CryptoCoinSwift/RIPEMD-Swift

Repository files navigation

RIPEMD-Swift

Native Swift implementation of the RIPEMD hash function.

Usage

Checkout the playground.

To digest an ASCII string:

let message         = "Lorem ipsum dolor sit amet"
let digest: String  = RIPEMD.asciiDigest(message)
-> "7d0982be59ebe828d02aa0d031aa6651644d60da"

To digest a string representing a hexadecimal number (e.g. a BigInt):

let message         = "600ffe422b4e00731a59557a5cca46cc183944191006324a447bdb2d98d4b408"
let digest: String  = RIPEMD.hexStringDigest(message) 
-> "010966776006953d5567439e5e39f86a0d273bee"

To digest bytes stored in NSData:

let data: NSData    = ...
let digest: String  = RIPEMD.digest(data) 

It can return an NSData object:

let digest: NSData  = RIPEMD.asciiDigest(message)

About

Native Swift implementation of the RIPEMD hash function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published