From 9c45cb031a785e23702199816002f79ae6f727bc Mon Sep 17 00:00:00 2001 From: V2Ray Date: Sat, 26 Sep 2015 22:32:45 +0200 Subject: [PATCH] Remove magic number --- proxy/vmess/protocol/user/id.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/vmess/protocol/user/id.go b/proxy/vmess/protocol/user/id.go index 63348656..f3b1fd66 100644 --- a/proxy/vmess/protocol/user/id.go +++ b/proxy/vmess/protocol/user/id.go @@ -14,8 +14,8 @@ const ( // The ID of en entity, in the form of an UUID. type ID struct { String string - Bytes [16]byte - cmdKey [16]byte + Bytes [IDBytesLen]byte + cmdKey [IDBytesLen]byte } func NewID(id string) (ID, error) { @@ -43,7 +43,7 @@ func (v ID) CmdKey() []byte { var byteGroups = []int{8, 4, 4, 4, 12} // TODO: leverage a full functional UUID library -func UUIDToID(uuid string) (v [16]byte, err error) { +func UUIDToID(uuid string) (v [IDBytesLen]byte, err error) { text := []byte(uuid) if len(text) < 32 { err = log.Error("uuid: invalid UUID string: %s", text)