@Override
        public Val eval(final StoredValues storedValues, final Supplier<ChildData> childDataSupplier) {

            final Val valToHash = childGenerators[0].eval(storedValues, childDataSupplier);
            if (!valToHash.type().isValue()) {
                return ValErr.wrap(valToHash, "First argument of '" + Hash.NAME + "' is not a value.");
            }

            final Val algo;
            if (childGenerators.length > 1) {
                algo = childGenerators[1].eval(storedValues, childDataSupplier);
                if (Val.isNull(algo)) {
                    messageDigest = DEFAULT_ALGORITHM_DIGEST;
                } else if (!algo.type().isValue()) {
                    return ValErr.wrap(algo, "Second argument of '" + Hash.NAME + "' is not a value.");
                }
            } else {
                algo = ValNull.INSTANCE;
            }

            final Val salt;
            if (childGenerators.length > 2) {
                salt = childGenerators[2].eval(storedValues, childDataSupplier);
                if (!salt.type().isValue()) {
                    return ValErr.wrap(salt, "Third argument of '" + Hash.NAME + "' is not a value.");
                }
            } else {
                salt = ValNull.INSTANCE;
            }

            try {
                if (messageDigest != null) {
                    return ValString.create(hash(
                            NullSafe.get(valToHash, Val::toString),
                            messageDigest,
                            NullSafe.get(salt, Val::toString)));
                } else {
                    return ValString.create(hash(
                            NullSafe.get(valToHash, Val::toString),
                            NullSafe.getOrElse(algo, Val::toString, DEFAULT_ALGORITHM),
                            NullSafe.get(salt, Val::toString)));
                }

            } catch (final RuntimeException | ParseException e) {
                return ValErr.create(e.getMessage());
            }
        }
For cases where the algorithm and salt are both static
stroom-query/stroom-query-language/src/main/java/stroom/query/language/functions/Hash.java