Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/SHA-256/Haskell/sha-256.hs
Normal file
12
Task/SHA-256/Haskell/sha-256.hs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import Data.Char (ord)
|
||||
import Crypto.Hash.SHA256 (hash)
|
||||
import Data.ByteString (unpack, pack)
|
||||
import Text.Printf (printf)
|
||||
|
||||
main = putStrLn $ -- output to terminal
|
||||
concatMap (printf "%02x") $ -- to hex string
|
||||
unpack $ -- to array of Word8
|
||||
hash $ -- SHA-256 hash to ByteString
|
||||
pack $ -- to ByteString
|
||||
map (fromIntegral.ord) -- to array of Word8
|
||||
"Rosetta code"
|
||||
Loading…
Add table
Add a link
Reference in a new issue