Shift operations should be unsigned integers

This commit is contained in:
linyufeng 2022-07-15 15:44:05 +08:00
parent 336f12e56a
commit f97d30ec19
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ import (
"strings"
)
var shiftIndex = []int{24, 16, 8, 0}
var shiftIndex = []uint32{24, 16, 8, 0}
func CheckIP(ip string) (uint32, error) {
var ps = strings.Split(ip, ".")

View File

@ -12,7 +12,7 @@ import (
// Util function
var shiftIndex = []int{24, 16, 8, 0}
var shiftIndex = []uint32{24, 16, 8, 0}
func CheckIP(ip string) (uint32, error) {
var ps = strings.Split(ip, ".")