Function lsm::size_human_2_size_bytes [] [src]

pub fn size_human_2_size_bytes(s: &str) -> u64

Convert human readable size string into integer size in bytes.

Following rules of IEC binary prefixes on size. Supported size string formats:

  • 1.9KiB gets (1024 * 1.9) as u64.
  • 1 KiB gets 1 * (1 << 10).
  • 1B gets 1u64.
  • 2K is the same as 2KiB.
  • 2k is the same as 2KiB.
  • 2KB gets 2 * 1000.

Return 0 if error.