In my user database table, I take the MD5 hash of the email address of a user as the id.
Example: email(example@example.org) = id(d41d8cd98f00b204e9800998ecf8427e)
Unfortunately, I have to represent the ids as integer values now - in order to be able to use an API where the id can only be an integer.
Now I'm looking for a way to encode the id into an integer for sending an decode it again when receiving. How could I do this?
My ideas so far:
convert_uuencode()
andconvert_uudecode()
for the MD5 hash- replace every character of the MD5 hash by its
ord()
value
Which approach is better? Do you know even better ways to do this?
I hope you can help me. Thank you very much in advance!