Python 3 compat. fix

I don't know why, but now I'm getting this error:

    TypeError: Unicode-objects must be encoded before hashing

But just enconding the string before hashing solves the issue.