We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shiftR bs i | i `mod` 8 == 0 = B.take (B.length bs) $ B.append (B.replicate (i `div` 8) 0) (B.drop (i `div` 8) bs)
should be
shiftR bs i | i `mod` 8 == 0 = B.take (B.length bs) $ B.append (B.replicate (i `div` 8) 0) (B.take(i `div` 8) bs)
The text was updated successfully, but these errors were encountered:
With original code
λ> B.unpack $ (B.pack [0xFF, 0, 0, 0]) `shiftR` 8 [0,0,0,0]
After your update buffer becomes shorter
λ> B.unpack $ (B.pack [0xFF, 0, 0, 0]) `shiftR` 8 [0,255]
Sorry, something went wrong.
So finally it should become something like this
shiftR bs i | i `mod` 8 == 0 = B.take (B.length bs) $ B.replicate (i `div` 8) 0 <> B.take (i `div` 8) bs <> B.drop (i `div` 8) bs ...
No branches or pull requests
should be
The text was updated successfully, but these errors were encountered: