lundi 5 octobre 2020

Is there a way to generate a Hash Function which returns hash code of type signed long long?

I need a function which can take string as an input and generate hash code out of it. Currently, in c++ we have std::hash to do this but this returns the hash code of type size_t( unsigned long long ). Here, I need a hash function which can give me the hash code of type signed long long.

I have also tried using the modulus operator but that gives me negative values and those are not reliable. Hence, pls advise me on the hash function I can use in C++ so that I get hash code of type signed long long.

Aucun commentaire:

Enregistrer un commentaire