public void IsByteTokenEquelTest( ) { Guid guid = new Guid("56b79cac-91e8-460f-95ce-72b39e19185e"); byte[] b2 = new byte[32]; guid.ToByteArray( ).CopyTo(b2, 12); Assert.IsTrue(SoftBasic.IsByteTokenEquel(b2, guid)); }
public void IsTwoTokenEquelExample( ) { #region IsTwoTokenEquelExample Guid guid = new Guid("56b79cac-91e8-460f-95ce-72b39e19185e"); byte[] b2 = new byte[32]; guid.ToByteArray( ).CopyTo(b2, 12); Console.WriteLine(SoftBasic.IsByteTokenEquel(b2, guid)); // 输出 true #endregion }
/// <summary> /// 检查当前的头子节信息的令牌是否是正确的 /// </summary> /// <param name="headBytes">头子节数据</param> /// <returns>令牌是验证成功</returns> protected bool CheckRemoteToken(byte[] headBytes) { return(SoftBasic.IsByteTokenEquel(headBytes, Token)); }