libp2p-hs-0.1.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

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

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).