Exemple #1
0
        /// <summary>
        /// Evaluates the function on a scalar argument.
        /// </summary>
        /// <param name="Argument">Function argument.</param>
        /// <param name="Variables">Variables collection.</param>
        /// <returns>Function result.</returns>
        public override IElement EvaluateScalar(IElement Argument, Variables Variables)
        {
            if (!(Argument.AssociatedObjectValue is byte[] Bin))
            {
                throw new ScriptRuntimeException("Binary data expected.", this);
            }

            return(new ObjectValue(Hashes.ComputeSHA384Hash(Bin)));
        }