php - Crypt int into 4-char String -
i'd crypt int 7'000'000 4-char string , decrypt back.
any idea on how can easy achieved php?
clarification
i want create unique slug each wordpress user based on user id length of 4 chars.
example.com/rdfy
log2(7,000,000) = 22.7 or < 3 full bytes. make value 4-byte integer , cast 4-byte array , base64 encode least significant 3 bytes 4-bytes, encoding, not encryption may suffice.
if need encryption encrypt byte array using substitution cipher, sure not strong encryption.
Comments
Post a Comment