]> git.rkrishnan.org Git - functorrent.git/blob - src/Utils.hs
019b06bde49a425fe2d71a6817ed24441536da7f
[functorrent.git] / src / Utils.hs
1 module Utils where
2
3 import qualified Data.ByteString.Char8 as BC
4
5 splitN :: Int -> BC.ByteString -> [BC.ByteString]
6 splitN n bs | BC.null bs = []
7             | otherwise = BC.take n bs : splitN n (BC.drop n bs)