private static long symbolCode(String str) {
        try {
            MessageDigest md = java.security.MessageDigest.getInstance("SHA-1");
            byte[] buf = md.digest(Utf8.toBytes(str));
            if (buf.length >= 8) {
                long ret = 0;
                for (int i = 0; i < 8; ++i) {
                    ret = (ret << 8) + (buf[i] & 0xff);
                }
                return ret;
            }
        } catch (NoSuchAlgorithmException e) {
            throw new Error("java must always support SHA-1 message digest format", e);
        }
        return str.hashCode();
    }
Returns a more unique hash code than what Java's own {@link
String#hashCode()} method would produce.

@param str The string to hash.
@return A 64 bit long hash code.
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/ExpressionFunction.java