ds: improve hashing