Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- truncateInNixWay :: Int -> ByteString -> ByteString
Documentation
truncateInNixWay :: Int -> ByteString -> ByteString Source #
Bytewise truncation of a Digest
.
When truncation length is greater than the length of the bytestring
but less than twice the bytestring length, truncation splits the
bytestring into a head part (truncation length) and tail part
(leftover part), right-pads the leftovers with 0 to the truncation
length, and combines the two strings bytewise with xor
.