Example #1
0
        public void when_bytes_is_empty_should_throw_ArgumentNullException()
        {
            byte[] bytes = new byte[0];

            Assert.Throws <ArgumentNullException>(() => HashProvider.New(bytes));
        }
Example #2
0
 /// <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());
 }
Example #3
0
        public HashProvider BuildHashProvider(string value)
        {
            var bytes = value.GetBytes();

            return(HashProvider.New(bytes));
        }