public void when_bytes_is_empty_should_throw_ArgumentNullException() { byte[] bytes = new byte[0]; Assert.Throws <ArgumentNullException>(() => HashProvider.New(bytes)); }
/// <summary> /// 获取SHA256 /// </summary> /// <param name="bytes">原始byte数组</param> /// <returns>32byte的数组</returns> // ReSharper disable once InconsistentNaming public static byte[] GetSHA256(this byte[] bytes) { return(HashProvider.New(bytes).GetSHA256()); }
public HashProvider BuildHashProvider(string value) { var bytes = value.GetBytes(); return(HashProvider.New(bytes)); }