Skip to content

RuneStar/cache-names

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

cache-names Discord

View all

Some files in the Old School RuneScape cache contain a hash of their name. The only way to find out the names of these files is to reverse the hashes.

The following hash function is used:

public static int hash(String s) {
    byte[] bytes = s.toLowerCase(Locale.ROOT).getBytes(Charset.forName("windows-1252"));
    int h = 0;
    for (byte b : bytes) {
        h = h * 31 + b;
    }
    return h;
}

It is equivalent to s.toLowerCase(Locale.ROOT).hashCode() for ASCII-only inputs