Safe Haskell | None |
---|---|
Language | Haskell2010 |
Encode numbers to and from bytestrings using the (S)LEB128 encoding.
The implementation is backed by the generic algorithms defined in Codec.LEB128.Generic.
Synopsis
- toULEB128Builder :: LEB128 a => a -> Builder
- toSLEB128Builder :: SLEB128 a => a -> Builder
- toULEB128ByteString :: LEB128 a => a -> ByteString
- toSLEB128ByteString :: SLEB128 a => a -> ByteString
- fromULEB128ByteString :: LEB128 a => ByteString -> (Maybe a, ByteString)
- fromSLEB128ByteString :: SLEB128 a => ByteString -> (Maybe a, ByteString)
- fromULEB128ByteStringN :: ByteString -> (Maybe Natural, ByteString)
- fromSLEB128ByteStringI :: ByteString -> (Maybe Integer, ByteString)
- fromULEB128ByteStringUnsafe :: LEB128 a => ByteString -> (a, ByteString)
- fromSLEB128ByteStringUnsafe :: SLEB128 a => ByteString -> (a, ByteString)
- fromULEB128ByteStringNUnsafe :: ByteString -> (Natural, ByteString)
- fromSLEB128ByteStringIUnsafe :: ByteString -> (Integer, ByteString)
Encode values as bytestring builder.
toULEB128Builder :: LEB128 a => a -> Builder Source #
Encode values as bytestring builder.
toSLEB128Builder :: SLEB128 a => a -> Builder Source #
Encode value as bytestring.
toULEB128ByteString :: LEB128 a => a -> ByteString Source #
toSLEB128ByteString :: SLEB128 a => a -> ByteString Source #
Encode value from bytestring.
fromULEB128ByteString :: LEB128 a => ByteString -> (Maybe a, ByteString) Source #
fromSLEB128ByteString :: SLEB128 a => ByteString -> (Maybe a, ByteString) Source #
Encode value from bytestring. Throws an error if not enough bytes are provided.
fromULEB128ByteStringUnsafe :: LEB128 a => ByteString -> (a, ByteString) Source #
fromSLEB128ByteStringUnsafe :: SLEB128 a => ByteString -> (a, ByteString) Source #