diff options
Diffstat (limited to 'src/Data/Torrent/InfoHash.hs')
-rw-r--r-- | src/Data/Torrent/InfoHash.hs | 13 |
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 | ||
30 | import Control.Applicative | 26 | import Control.Applicative |
31 | import Control.Monad | 27 | import Control.Monad |
32 | import qualified Crypto.Hash.SHA1 as C | ||
33 | import Data.Aeson | 28 | import Data.Aeson |
34 | import Data.BEncode | 29 | import Data.BEncode |
35 | import Data.ByteString as BS | 30 | import Data.ByteString as BS |
@@ -151,14 +146,6 @@ shortHex = T.take 7 . longHex | |||
151 | ppHex :: BS.ByteString -> BS.ByteString | 146 | ppHex :: BS.ByteString -> BS.ByteString |
152 | ppHex = BL.toStrict . B.toLazyByteString . B.byteStringHexFixed | 147 | ppHex = BL.toStrict . B.toLazyByteString . B.byteStringHexFixed |
153 | 148 | ||
154 | -- | Hash strict bytestring using SHA1 algorithm. | ||
155 | hash :: BS.ByteString -> InfoHash | ||
156 | hash = InfoHash . C.hash | ||
157 | |||
158 | -- | Hash lazy bytestring using SHA1 algorithm. | ||
159 | hashlazy :: BL.ByteString -> InfoHash | ||
160 | hashlazy = 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> |