You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package utils |
|
|
|
func FastEqual[A string | []byte, B string | []byte](a A, b B) (same bool) { |
|
if len(a) != len(b) { |
|
return |
|
} |
|
ab := []byte(a) |
|
bb := []byte(b) |
|
for i, v := range ab { |
|
if v != bb[i] { |
|
return |
|
} |
|
} |
|
return true |
|
}
|
|
|