Safe Haskell | None |
---|---|
Language | Haskell2010 |
- fromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Mac
- toOctets :: Mac -> (Word8, Word8, Word8, Word8, Word8, Word8)
- encode :: Mac -> Text
- encodeWith :: MacCodec -> Mac -> Text
- decode :: Text -> Maybe Mac
- decodeWith :: MacCodec -> Text -> Maybe Mac
- decodeEither :: Text -> Either String Mac
- decodeEitherWith :: MacCodec -> Text -> Either String Mac
- builder :: Mac -> Builder
- parser :: Parser Mac
- parserWith :: MacCodec -> Parser Mac
- encodeUtf8 :: Mac -> ByteString
- encodeWithUtf8 :: MacCodec -> Mac -> ByteString
- decodeUtf8 :: ByteString -> Maybe Mac
- decodeWithUtf8 :: MacCodec -> ByteString -> Maybe Mac
- builderUtf8 :: Mac -> Builder
- parserUtf8 :: Parser Mac
- parserWithUtf8 :: MacCodec -> Parser Mac
- parserLenientUtf8 :: Parser Mac
- newtype Mac = Mac {}
- data MacCodec = MacCodec {}
- data MacGrouping
Convert
Textual Conversion
Text
UTF-8 ByteString
encodeUtf8 :: Mac -> ByteString Source #
encodeWithUtf8 :: MacCodec -> Mac -> ByteString Source #
decodeUtf8 :: ByteString -> Maybe Mac Source #
Lenient decoding of MAC address that accepts lowercase, uppercase, and any kind separator.
decodeWithUtf8 :: MacCodec -> ByteString -> Maybe Mac Source #
builderUtf8 :: Mac -> Builder Source #
Make a bytestring builder from a Mac
address
using a colon as the separator.
parserUtf8 :: Parser Mac Source #
Parser for a Mac
address using with a colon as the
separator (i.e. FA:43:B2:C0:0F:99
).
parserWithUtf8 :: MacCodec -> Parser Mac Source #
Parser for a Mac
address using the provided settings.
Types
A 48-bit MAC address. Do not use the data constructor for this type. It is not considered part of the stable API, and it allows you to construct invalid MAC addresses.
data MacGrouping Source #
The format expected by the mac address parser. The Word8
taken
by some of these constructors is the ascii value of the character
to be used as the separator. This is typically a colon, a hyphen, or
a space character. All decoding functions are case insensitive.
MacGroupingPairs !Char | Two-character groups, |
MacGroupingTriples !Char | Three-character groups, |
MacGroupingQuadruples !Char | Four-character groups, |
MacGroupingNoSeparator | No separator, |