Exemplo n.º 1
0
        private static KeccakStructRef InternalCompute(Span <byte> input)
        {
            var result = new KeccakStructRef();

            KeccakHash.ComputeHashBytesToSpan(input, result.Bytes);
            return(result);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }