|
|
@ -52,7 +52,7 @@ func init() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func parseSpeedString(speedString string) (uint64, error) {
|
|
|
|
func parseSpeedString(speedString string) (uint64, error) {
|
|
|
|
// 定义单位及其对应的字节值
|
|
|
|
// 定义单位及其对应的字节值
|
|
|
|
unitMultipliers := map[string]int{
|
|
|
|
unitMultipliers := map[string]int64{
|
|
|
|
"b": 1, "": 1,
|
|
|
|
"b": 1, "": 1,
|
|
|
|
"k": 1024, "kb": 1024, "kib": 1024,
|
|
|
|
"k": 1024, "kb": 1024, "kib": 1024,
|
|
|
|
"m": 1024 * 1024, "mb": 1024 * 1024, "mib": 1024 * 1024,
|
|
|
|
"m": 1024 * 1024, "mb": 1024 * 1024, "mib": 1024 * 1024,
|
|
|
|