Hoogle Search
Within LTS Haskell 24.43 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
jsByteString :: Js -> ByteStringweb-rep Web.Rep.Page No documentation available.
renderPageAsByteString :: PageConfig -> Page -> Concerns ByteStringweb-rep Web.Rep.Render Render a Page as Text.
renderLazyByteString :: View () () -> ByteStringweb-view Web.View No documentation available.
renderLazyByteString :: View () () -> ByteStringweb-view Web.View.Render No documentation available.
fromLEByteString :: ByteString -> Word16Stringwhat4 What4.Utils.Word16String Generate a Word16String from a bytestring where the 16bit words are encoded as two bytes in little-endian order. PRECONDITION: the input bytestring must have a length which is a multiple of 2.
toLEByteString :: Word16String -> ByteStringwhat4 What4.Utils.Word16String Return the underlying little endian bytestring.
xor32LazyByteString :: Word32 -> ByteString -> ByteStringxor Data.XOR Variant of xor32StrictByteString for masking lazy ByteStrings.
>>> xor32LazyByteString 0x37fa213d "\x7f\x9f\x4d\x51\x58" "Hello"
xor32ShortByteString :: Word32 -> ShortByteString -> ShortByteStringxor Data.XOR Apply 32-bit XOR mask (considered as four octets in big-endian order) to ShortByteString. See also xor32StrictByteString.
>>> xor32ShortByteString 0x37fa213d "\x7f\x9f\x4d\x51\x58" "Hello"
xor32StrictByteString :: Word32 -> ByteString -> ByteStringxor Data.XOR Apply 32-bit XOR mask (considered as four octets in big-endian order) to ByteString.
>>> xor32StrictByteString 0x37fa213d "\x7f\x9f\x4d\x51\x58" "Hello"
In other words, the 32-bit word 0x37fa213d is taken as the infinite series of octets (cycle [0x37,0xfa,0x21,0x3d]) and xored with the respective octets from the input ByteString. The xor laws give rise to the following laws:xor32StrictByteString m (xor32StrictByteString m x) == x
xor32StrictByteString 0 x == x
xor32StrictByteString m (xor32StrictByteString n x) == xor32StrictByteString (m `xor` n) x
This function is semantically equivalent to the (less efficient) implementation shown belowxor32StrictByteString'ref :: Word32 -> BS.ByteString -> BS.ByteString xor32StrictByteString'ref 0 = id xor32StrictByteString'ref msk0 = snd . BS.mapAccumL go msk0 where go :: Word32 -> Word8 -> (Word32,Word8) go msk b = let b' = fromIntegral (msk' .&. 0xff) `xor` b msk' = rotateL msk 8 in (msk',b')
The xor32StrictByteString implementation is about 6-7 times faster than the naive implementation above.xor32StrictByteString' :: Word32 -> ByteString -> (Word32, ByteString)xor Data.XOR Convenience version of xor32StrictByteString which also returns the rotated XOR-mask useful for chained masking.
>>> xor32StrictByteString' 0x37fa213d "\x7f\x9f\x4d\x51\x58" (0xfa213d37,"Hello")