Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
14
Task/SHA-1/Haskell/sha-1.hs
Normal file
14
Task/SHA-1/Haskell/sha-1.hs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
module Digestor
|
||||
where
|
||||
import Data.Digest.Pure.SHA
|
||||
import qualified Data.ByteString.Lazy as B
|
||||
|
||||
convertString :: String -> B.ByteString
|
||||
convertString phrase = B.pack $ map ( fromIntegral . fromEnum ) phrase
|
||||
|
||||
convertToSHA1 :: String -> String
|
||||
convertToSHA1 word = showDigest $ sha1 $ convertString word
|
||||
|
||||
main = do
|
||||
putStr "Rosetta Code SHA1-codiert: "
|
||||
putStrLn $ convertToSHA1 "Rosetta Code"
|
||||
Loading…
Add table
Add a link
Reference in a new issue