byte-count-reader-0.10.0.0: Read strings describing a number of bytes like 2Kb and 0.5 MiB

Copyright(c) Daniel Rolls 2020
LicenseGPL-3
Maintainerdaniel.rolls.27@googlemail.com
Safe HaskellSafe
LanguageHaskell2010

Data.ByteCountReader

Description

This library is for reading strings describing a number of bytes like 2Kb and 0.5 MiB. The units KB, MB, GB and TB imply base 10 (e.g. 2KB = 2 x 1000). The units KiB, MiB, GiB and TiB imply base 2 (e.g. 2KiB = 2 * 1024).

Synopsis

Documentation

sizeInBytes :: Text -> Maybe Integer Source #

Read strings describing a number of bytes like 2KB and 0.5 MiB. The units KB, MB, GB and TB are assumed to be base 10 (e.g. 2KB = 2 x 1000). The units KiB, MiB, GiB and TiB are assumed to be base 2 (e.g. 2KiB = 2 * 1024).