/// <summary> /// 比较当前byte数组与另一数组是否相等。 /// </summary> /// <param name="obj"></param> /// <param name="target">需要比较的数组。</param> /// <returns></returns> public static bool EqualsBytes(this byte[] obj, params byte[] target) { if (obj.Length != target.Length) return false; for (int i = 0; i < obj.Length; i++) { if (obj[i] != target[i]) return false; } return true; }