mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 09:30:26 +08:00
19 lines
313 B
Go
19 lines
313 B
Go
|
|
package utils
|
||
|
|
|
||
|
|
import (
|
||
|
|
"strings"
|
||
|
|
)
|
||
|
|
|
||
|
|
// 计算版本代号
|
||
|
|
func VersionToLong(version string) uint32 {
|
||
|
|
countDots := strings.Count(version, ".")
|
||
|
|
if countDots == 2 {
|
||
|
|
version += ".0"
|
||
|
|
} else if countDots == 1 {
|
||
|
|
version += ".0.0"
|
||
|
|
} else if countDots == 0 {
|
||
|
|
version += ".0.0.0"
|
||
|
|
}
|
||
|
|
return IP2Long(version)
|
||
|
|
}
|