| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | pxqr.sta@gmail.com |
| Safe Haskell | None |
Data.Torrent.InfoHash
Contents
Description
Infohash is a unique identifier of torrent.
- newtype InfoHash = InfoHash {}
- textToInfoHash :: Text -> Maybe InfoHash
- addHashToURI :: URI -> InfoHash -> URI
- ppInfoHash :: InfoHash -> Doc
- hash :: BS.ByteString -> InfoHash
- hashlazy :: BL.ByteString -> InfoHash
Info hash
Exactly 20 bytes long SHA1 hash of the info part of torrent file.
Constructors
| InfoHash | |
Fields | |
Instances
| Eq InfoHash | |
| Ord InfoHash | |
| Read InfoHash | for hex encoded strings |
| Show InfoHash | for hex encoded strings |
| IsString InfoHash | for base16 (hex) encoded strings |
| ToJSON InfoHash | Represented as base16 encoded string. |
| FromJSON InfoHash | Can be base16 or base32 encoded string. |
| Serialize InfoHash | |
| Hashable.Hashable InfoHash | |
| BEncode InfoHash | |
| URL.URLShow InfoHash |
textToInfoHash :: Text -> Maybe InfoHashSource
Tries both base16 and base32 while decoding info hash.
addHashToURI :: URI -> InfoHash -> URISource
Add query info hash parameter to uri.
info_hash=<url_encoded_info_hash>
ppInfoHash :: InfoHash -> DocSource
Pretty print info hash in hexadecimal format.
hash :: BS.ByteString -> InfoHashSource
Hash strict bytestring using SHA1 algorithm.
hashlazy :: BL.ByteString -> InfoHashSource
Hash lazy bytestring using SHA1 algorithm.