Exemple #1
0
        private static KeccakStructRef InternalCompute(Span <byte> input)
        {
            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(input, result.Bytes);
            return(result);
        }
Exemple #2
0
        public static KeccakStructRef Compute(string input)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes));
            }

            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(System.Text.Encoding.UTF8.GetBytes(input), result.Bytes);
            return(result);
        }
Exemple #3
0
        public static KeccakStructRef Compute(Span <byte> input)
        {
            if (input.Length == 0)
            {
                return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes));
            }

            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(input, result.Bytes);
            return(result);
        }
Exemple #4
0
 public bool Equals(KeccakStructRef other) => Core.Extensions.Bytes.AreEqual(other.Bytes, Bytes);