From 9e932d508dfd237e22f5a6dd6a351bae646c54e5 Mon Sep 17 00:00:00 2001 From: Sam T Date: Wed, 17 Apr 2013 12:13:58 +0400 Subject: ~ Fix docs markup. --- src/Network/Torrent/PeerID.hs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Network/Torrent/PeerID.hs b/src/Network/Torrent/PeerID.hs index 3f41b99a..7071bc9b 100644 --- a/src/Network/Torrent/PeerID.hs +++ b/src/Network/Torrent/PeerID.hs @@ -4,19 +4,23 @@ -- though this module exports some other goodies for custom generation. -- module Network.Torrent.PeerID - ( -- ^ Peer addr + ( -- * Peer addr Peer(..) , peerSockAddr, connectToPeer - -- ^ Peer identification + -- * Peer identification , PeerID (getPeerID) - -- * Encoding styles + + -- ** Encoding styles , azureusStyle, shadowStyle - -- * Defaults + + -- ** Defaults , defaultClientID, defaultVersionNumber - -- * Generation + + -- ** Generation , newPeerID, timestampByteString - -- * Extra + -- ** Extra + , byteStringPadded ) where @@ -64,12 +68,12 @@ peerSockAddr = SockAddrInet <$> (g . peerPort) <*> (htonl . peerIP) htonl :: Word32 -> Word32 htonl d = ((d .&. 0xff) `shiftL` 24) .|. - (((d `shiftR` 8 ) .&. 0xff) `shiftL` 16) .|. - (((d `shiftR` 16) .&. 0xff) `shiftL` 8) .|. + (((d `shiftR` 8 ) .&. 0xff) `shiftL` 16) .|. + (((d `shiftR` 16) .&. 0xff) `shiftL` 8) .|. ((d `shiftR` 24) .&. 0xff) g :: PortNumber -> PortNumber - g (PortNum x) = PortNum x -- $ (x `shiftR` 8) .|. (x `shiftL` 8) + g = id -- ipv6 extension -- | Tries to connect to peer using reasonable default parameters. -- cgit v1.2.3