leb128-0.1.0.0: LEB128 encoding logic for and in Haskell

Copyright(c) Andreas Klebinger 2020
LicenseBSD3
MaintainerAndreas Klebinger
PortabilityGHC >= 7.10 This module specializes the generic algorithms defined in "Codec.LEB128.Generic" to use ByteString as byte sequence representation.
Safe HaskellNone
LanguageHaskell2010

Codec.LEB128.Internal.BS

Description

 
Synopsis

Documentation

fromULEB128 :: forall a. LEB128 a => ByteString -> (Maybe a, ByteString) Source #

Decode a value in unsigned LEB128 encoding and return remaining bytes.

fromSLEB128 :: forall a. SLEB128 a => ByteString -> (Maybe a, ByteString) Source #

Decode a value in (signed) SLEB128 encoding and return remaining bytes.

fromULEB128Unsafe :: LEB128 a => ByteString -> (a, ByteString) Source #

Decode a value in unsigned LEB128 encoding and return remaining bytes.

fromSLEB128Unsafe :: SLEB128 a => ByteString -> (a, ByteString) Source #

Decode a value in (signed) SLEB128 encoding and return remaining bytes.

toULEB128 :: LEB128 a => a -> Builder Source #

Encode a unsigned value as bytestring builder in LEB128 encoding.

toSLEB128 :: SLEB128 a => a -> Builder Source #

Encode a signed value as bytestring builder in SLEB128 encoding.