v2ray 9 년 전
부모
커밋
28cf3aa0c7
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      common/serial/numbers.go

+ 20 - 0
common/serial/numbers.go

@@ -46,6 +46,26 @@ func (this IntLiteral) Bytes() []byte {
 	}
 }
 
+type Uint32Literal uint32
+
+func (this Uint32Literal) String() string {
+	return strconv.FormatUint(uint64(this.Value()), 10)
+}
+
+func (this Uint32Literal) Value() uint32 {
+	return uint32(this)
+}
+
+func (this Uint32Literal) Bytes() []byte {
+	value := this.Value()
+	return []byte{
+		byte(value >> 24),
+		byte(value >> 16),
+		byte(value >> 8),
+		byte(value),
+	}
+}
+
 type Int64Literal int64
 
 func (this Int64Literal) String() string {