Merge pull request #826 from apernet/wip-fix-bpsconv

fix: bps conv (should be 1000 not 1024)
This commit is contained in:
Toby 2023-11-18 20:58:41 -08:00 committed by GitHub
commit ee3a23fb3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,11 @@ import (
) )
const ( const (
Byte = 1.0 << (10 * iota) Byte = 1
Kilobyte Kilobyte = Byte * 1000
Megabyte Megabyte = Kilobyte * 1000
Gigabyte Gigabyte = Megabyte * 1000
Terabyte Terabyte = Gigabyte * 1000
) )
// StringToBps converts a string to a bandwidth value in bytes per second. // StringToBps converts a string to a bandwidth value in bytes per second.