-
-
Save dminuoso/540361a14d721b430c4bd1f7b84b866a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pprMac :: Mac -> T.Text | |
pprMac mac = let (w1, w2, w3, w4, w5, w6) = macToWord8s mac | |
in T.pack [ intToDigit (fromIntegral (w1 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w1 .&. 0xf)) | |
, ':' | |
, intToDigit (fromIntegral (w2 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w2 .&. 0xf)) | |
, ':' | |
, intToDigit (fromIntegral (w3 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w3 .&. 0xf)) | |
, ':' | |
, intToDigit (fromIntegral (w4 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w4 .&. 0xf)) | |
, ':' | |
, intToDigit (fromIntegral (w5 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w5 .&. 0xf)) | |
, ':' | |
, intToDigit (fromIntegral (w6 `unsafeShiftR` 4)) | |
, intToDigit (fromIntegral (w6 .&. 0xf)) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment