summaryrefslogtreecommitdiff
path: root/src/Data/Torrent/InfoHash.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Torrent/InfoHash.hs')
-rw-r--r--src/Data/Torrent/InfoHash.hs13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs
index fd57700a..e9e6cf39 100644
--- a/src/Data/Torrent/InfoHash.hs
+++ b/src/Data/Torrent/InfoHash.hs
@@ -21,15 +21,10 @@ module Data.Torrent.InfoHash
21 , shortHex 21 , shortHex
22 22
23 , addHashToURI 23 , addHashToURI
24
25 -- * Internal
26 , Data.Torrent.InfoHash.hash
27 , Data.Torrent.InfoHash.hashlazy
28 ) where 24 ) where
29 25
30import Control.Applicative 26import Control.Applicative
31import Control.Monad 27import Control.Monad
32import qualified Crypto.Hash.SHA1 as C
33import Data.Aeson 28import Data.Aeson
34import Data.BEncode 29import Data.BEncode
35import Data.ByteString as BS 30import Data.ByteString as BS
@@ -151,14 +146,6 @@ shortHex = T.take 7 . longHex
151ppHex :: BS.ByteString -> BS.ByteString 146ppHex :: BS.ByteString -> BS.ByteString
152ppHex = BL.toStrict . B.toLazyByteString . B.byteStringHexFixed 147ppHex = BL.toStrict . B.toLazyByteString . B.byteStringHexFixed
153 148
154-- | Hash strict bytestring using SHA1 algorithm.
155hash :: BS.ByteString -> InfoHash
156hash = InfoHash . C.hash
157
158-- | Hash lazy bytestring using SHA1 algorithm.
159hashlazy :: BL.ByteString -> InfoHash
160hashlazy = InfoHash . C.hashlazy
161
162-- | Add query info hash parameter to uri. 149-- | Add query info hash parameter to uri.
163-- 150--
164-- > info_hash=<url_encoded_info_hash> 151-- > info_hash=<url_encoded_info_hash>