summaryrefslogtreecommitdiff
path: root/src/Data/Torrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-28 06:54:51 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-28 06:54:51 +0400
commit53d47a403f8e940f6f55f292c3d5d4b2edc0b3cb (patch)
tree2675d9309f1412510dccbc8bb64e1b4fe4e48920 /src/Data/Torrent
parent32027c2d4392fb6964bafe3aaf6d427e5d827d21 (diff)
Hide InfoHash internal functions
Diffstat (limited to 'src/Data/Torrent')
-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>