1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00
This commit is contained in:
Darien Raymond 2016-12-07 13:13:48 +01:00
parent 2f550186ac
commit 2e1c2b95e0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -5,7 +5,6 @@ import (
"crypto/md5" "crypto/md5"
"hash" "hash"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/uuid" "v2ray.com/core/common/uuid"
) )
@ -13,10 +12,6 @@ const (
IDBytesLen = 16 IDBytesLen = 16
) )
var (
InvalidID = errors.New("Invalid ID.")
)
type IDHash func(key []byte) hash.Hash type IDHash func(key []byte) hash.Hash
func DefaultIDHash(key []byte) hash.Hash { func DefaultIDHash(key []byte) hash.Hash {
@ -29,6 +24,7 @@ type ID struct {
cmdKey [IDBytesLen]byte cmdKey [IDBytesLen]byte
} }
// Equals returns true if this ID equals to the other one.
func (v *ID) Equals(another *ID) bool { func (v *ID) Equals(another *ID) bool {
return v.uuid.Equals(another.uuid) return v.uuid.Equals(another.uuid)
} }