1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-10 04:59:15 -04:00

typed segments

This commit is contained in:
v2ray
2016-06-27 22:22:01 +02:00
parent 27b8715b63
commit 6915095a0a
5 changed files with 317 additions and 1 deletions

View File

@@ -16,6 +16,10 @@ func Uint32ToBytes(value uint32, b []byte) []byte {
return append(b, byte(value>>24), byte(value>>16), byte(value>>8), byte(value))
}
func Uint32ToString(value uint32) string {
return strconv.FormatUint(uint64(value), 10)
}
func IntToBytes(value int, b []byte) []byte {
return append(b, byte(value>>24), byte(value>>16), byte(value>>8), byte(value))
}