asn1-types-0.3.4: ASN.1 types

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell98

Data.ASN1.BitArray

Description

Synopsis

- data BitArray = BitArray Word64 ByteString
- data BitArrayOutOfBound = BitArrayOutOfBound Word64
- bitArrayLength :: BitArray -> Word64
- bitArrayGetBit :: BitArray -> Word64 -> Bool
- bitArraySetBitValue :: BitArray -> Word64 -> Bool -> BitArray
- bitArraySetBit :: BitArray -> Word64 -> BitArray
- bitArrayClearBit :: BitArray -> Word64 -> BitArray
- bitArrayGetData :: BitArray -> ByteString
- toBitArray :: ByteString -> Int -> BitArray

# Documentation

data BitArray Source #

represent a bitarray / bitmap

the memory representation start at bit 0

Constructors

BitArray Word64 ByteString |

#### Instances

Instances details

Show BitArray Source # |
Instance details Defined in Data.ASN1.BitArray Methods showsPrec :: Int -> BitArray -> ShowS Source # show :: BitArray -> String Source # showList :: [BitArray] -> ShowS Source #
Eq BitArray Source # |
Instance details Defined in Data.ASN1.BitArray Methods (==) :: BitArray -> BitArray -> Bool Source # (/=) :: BitArray -> BitArray -> Bool Source #

data BitArrayOutOfBound Source #

throwed in case of out of bounds in the bitarray.

Constructors

BitArrayOutOfBound Word64 |

#### Instances

Instances details

Exception BitArrayOutOfBound Source # |
Instance details Defined in Data.ASN1.BitArray Methods toException :: BitArrayOutOfBound -> SomeException Source # fromException :: SomeException -> Maybe BitArrayOutOfBound Source # displayException :: BitArrayOutOfBound -> String Source # backtraceDesired :: BitArrayOutOfBound -> Bool Source #
Show BitArrayOutOfBound Source # |
Instance details Defined in Data.ASN1.BitArray Methods showsPrec :: Int -> BitArrayOutOfBound -> ShowS Source # show :: BitArrayOutOfBound -> String Source # showList :: [BitArrayOutOfBound] -> ShowS Source #
Eq BitArrayOutOfBound Source # |
Instance details Defined in Data.ASN1.BitArray Methods (==) :: BitArrayOutOfBound -> BitArrayOutOfBound -> Bool Source # (/=) :: BitArrayOutOfBound -> BitArrayOutOfBound -> Bool Source #

bitArrayLength :: BitArray -> Word64 Source #

returns the length of bits in this bitarray

bitArrayGetBit :: BitArray -> Word64 -> Bool Source #

get the nth bits

bitArraySetBitValue :: BitArray -> Word64 -> Bool -> BitArray Source #

set the nth bit to the value specified

bitArraySetBit :: BitArray -> Word64 -> BitArray Source #

set the nth bits

bitArrayClearBit :: BitArray -> Word64 -> BitArray Source #

clear the nth bits

bitArrayGetData :: BitArray -> ByteString Source #

get padded bytestring of the bitarray

toBitArray :: ByteString -> Int -> BitArray Source #

number of bit to skip at the end (padding)