mirror of https://github.com/v2ray/v2ray-core
parent
7392bb495b
commit
97a09bb5bd
|
@ -20,6 +20,7 @@ func BytesToUint32(value []byte) uint32 {
|
||||||
uint32(value[3])
|
uint32(value[3])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BytesToInt deserializes a bytes array (of at leat 4 bytes) to an int in big endian order.
|
||||||
func BytesToInt(value []byte) int {
|
func BytesToInt(value []byte) int {
|
||||||
return int(value[0])<<24 |
|
return int(value[0])<<24 |
|
||||||
int(value[1])<<16 |
|
int(value[1])<<16 |
|
||||||
|
|
Loading…
Reference in New Issue