Std.Human.parseBytes
1 declaration
fn
parseBytes: Str -> Result[Int, Std.Human.HumanError]A byte count read from text such as 512, 1.5 KiB, 10MB, or 2gib.
Letters are read without regard to case. The two families of unit are kept apart because they differ by seven percent at a gigabyte: k, kb, m, mb and the rest count in thousands, ki, kib, mi, mib and the rest in powers of 1024. A fraction is admitted when it comes to a whole number of bytes, so 1.5KiB is 1536 while 1.1B is refused.
