Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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