readBsNum :: (Integral a) => BS.ByteString -> a
readBsNum bs = go (reverse . map readChar . BS.unpack $ bs) 0 1
  where
    go [] num _ = num
    go (x:xs) num cnt = go xs (num + (x * cnt)) (cnt*10)
readBsNum :: (Integral a) => BS.ByteString -> a
readBsNum bs = go (reverse . map readChar . BS.unpack $ bs) 0 1
  where
    go [] num _ = num
    go (x:xs) num cnt = go xs (num + (x * cnt)) (cnt*10)
readBsNum bs = go (reverse . map readChar . BS.unpack $ bs) 0 1
  where
    go [] num _ = num
    go (x:xs) num cnt = go xs (num + (x * cnt)) (cnt*10)