{"modulePath":"github.com/github/git-lfs","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package humanize\n\npackage humanize is designed to parse and format \"humanized\" versions of numbers with units.\n\nBased on: github.com/dustin/go-humanize.\n\n## Constants\n\n```go\nconst (\n\tByte = 1 \u003c\u003c (iota * 10)\n\tKibibyte\n\tMebibyte\n\tGibibyte\n\tTebibyte\n\tPebibyte\n\n\tKilobyte = 1000 * Byte\n\tMegabyte = 1000 * Kilobyte\n\tGigabyte = 1000 * Megabyte\n\tTerabyte = 1000 * Gigabyte\n\tPetabyte = 1000 * Terabyte\n)\n```\n\n## Functions\n\n```go\nfunc FormatByteRate(s uint64, d time.Duration) string\n```\nFormatByteRate outputs the given rate of transfer \"r\" as the quotient of \"s\" (the number of bytes transferred) over \"d\" (the duration of time that those bytes were transferred in).\n\nIt displays the output as a quantity of a \"per-unit-time\" unit (i.e., B/s, MiB/s) in the most representative fashion possible, as above.\n\n```go\nfunc FormatBytes(s uint64) string\n```\nFormatBytes outputs the given number of bytes \"s\" as a human-readable string, rounding to the nearest half within .01.\n\n```go\nfunc FormatBytesUnit(s, u uint64) string\n```\nFormatBytesUnit outputs the given number of bytes \"s\" as a quantity of the given units \"u\" to the nearest half within .01.\n\n```go\nfunc ParseByteUnit(str string) (uint64, error)\n```\nParseByteUnit returns the number of bytes in a given unit of storage, or an error, if that unit is unrecognized.\n\n```go\nfunc ParseBytes(str string) (uint64, error)\n```\nParseBytes parses a given human-readable bytes or ibytes string into a number of bytes, or an error if the string was unable to be parsed.\n\n","path":"github.com/github/git-lfs/tools/humanize","name":"humanize","synopsis":"package humanize is designed to parse and format \"humanized\" versions of numbers with units.","isRedistributable":true}
