Compute MD5 message digests in Elm.
This library exposes just one function,
hex, which takes a
String input and returns the 128-bit MD5
digest as a
String of 32 hexadecimal characters.
MD5.hex "" == "d41d8cd98f00b204e9800998ecf8427e" MD5.hex "foobarbaz" == "6df23dc03f9b54cc38a0fc1483df6e21"
myHex : String -> String myHex input = let myInput = Regex.replace Regex.All (Regex.regex "\x0D\n") (\_ -> "\n") input in MD5.hex myInput
There are versions of this library for Elm 0.17.1 and 0.18. As I probably won't be maintaining this module any longer, for future Elm versions please check out a fork of this project, truqu/elm-md5.
Install the package as normal for Elm 0.18 (
elm package install sanichi/elm-md5).
However, for Elm 0.17.1, there is an as yet undiagnosed problem with the normal method of installation. Please use the following workaround:
elm-package.jsonif you haven't already done so.