LoginSignup
0

More than 3 years have passed since last update.

HaskellでMD5 #Haskell

Posted at

HaskellでMD5を使う方法です.
少し悩んだのでほぼ個人用メモ.

使うパッケージ

  • cryptohash
import qualified Data.ByteString as BS
import           Crypto.Hash     ( Digest
                                 , MD5
                                 , hash
                                 , digestToHexByteString )

md5 :: BS.ByteString -> Digest MD5
md5 =  hash

こんな感じにしてやって, md5 "ByteStringの文字列"みたいにしてやると結果が返って来ます.
ByteStringの値として扱いたい場合はdigestToHexByteString . md5みたいにしてやると良いです.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0