1 module FuncTorrent.Utils where
3 import qualified Data.ByteString.Char8 as BC
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)
9 splitNum :: Integer -> Integer -> [Integer]
10 splitNum n d | n == 0 = []
12 | otherwise = d : splitNum (n - d) d