| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Network.LibP2P.Core.Binary
Description
Big-endian binary encoding/decoding helpers.
Shared utilities for network byte order (BE) encoding used by Multiaddr, Noise framing, and other wire-format modules.
Synopsis
- word16BE :: Word16 -> ByteString
- word32BE :: Word32 -> ByteString
- readWord16BE :: ByteString -> Word16
- readWord32BE :: ByteString -> Word32
Documentation
word16BE :: Word16 -> ByteString Source #
Encode a Word16 as 2-byte big-endian ByteString.
word32BE :: Word32 -> ByteString Source #
Encode a Word32 as 4-byte big-endian ByteString.
readWord16BE :: ByteString -> Word16 Source #
Read a big-endian Word16 from a ByteString (must be >= 2 bytes).
readWord32BE :: ByteString -> Word32 Source #
Read a big-endian Word32 from a ByteString (must be >= 4 bytes).