Sorts input hashes for faster lookups