bytepatch-0.3.1: Patch byte-representable data in a bytestream.
Safe HaskellNone
LanguageHaskell2010

StreamPatch.Patch.Binary.PascalText

Description

Newtype for manipulating length-prefixed strings.

This type is for UTF-8 Text that you intend to write out to a length-prefixed bytestring. The size of the length field is static. You essentially have to decide the maximum bytesize of the string on creation.

Synopsis

Documentation

newtype PascalText (n :: Nat) Source #

Constructors

PascalText 

Fields

Instances

Instances details
KnownNat n => BinRep (PascalText n) Source # 
Instance details

Defined in StreamPatch.Patch.Binary.PascalText

i2be :: (Integral a, Bits a) => a -> ByteString Source #

Re-encode an Integer to a little-endian integer stored as a ByteString using the fewest bytes needed to represent it.

adapated from crypto-api 0.13.3, Crypto.Util.i2bs_unsized