@Override
    protected void doExecute(ExecutionContext context) {
        StringFieldValue input = (StringFieldValue) context.getCurrentValue();
        if (DataType.INT.equals(targetType) || ( ! DataType.LONG.equals(targetType) && requireOutputType().equals(DataType.INT)))
            context.setCurrentValue(new IntegerFieldValue(hashToInt(input.getString())));
        else if (DataType.LONG.equals(targetType) || requireOutputType().equals(DataType.LONG))
            context.setCurrentValue(new LongFieldValue(hashToLong(input.getString())));
        else
            throw new IllegalStateException(); // won't happen
    }
Hashes a string value to a long or int (by type inference on the target value).

@author bratseth
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/HashExpression.java