B64 decode online dating
Requests need to be uploaded and 99% of the world are limited on their upload speed to the server.function urlsafe_b64encode($string) function urlsafe_b64decode($string) Php version of perl's MIME:: Base64:: URLSafe, that provides an url-safe base64 string encoding/decoding (compatible with python base64's urlsafe methods) Unfortunately my "function" for encoding base64 on-the-fly from 2007 [which has been removed from the manual in favor of this post] had 2 errors!
What that means is that each line can be decoded independently of the others, and the decoded chunks can then be concatenated together or written out sequentially.
My solution (uses modified base64 functions by Tom):function base64url_encode($plain Text) function base64url_decode($plain Text) function encrypt Id($int, $class='') function decrypt Id($string, $class='') - The optional 2nd argument is the class name, so two equal ids of different tables will not result in two equal obfuscated ids.- encryption Key is a global secret key for encryption.- decrypt Id() checks if the second part of the base64 encoded string is correct.
If you use base64encoded strings as cookie names, make sure you remove '=' characters.
* If $n is not specified, Secure:: RANDOM_LENGTH is assumed. * * @param int $n Specifies the length of the random string * @param bool $padding * @return string The result may contain A-Z, a-z, 0-9, "-" and "_". */ I needed a simple way to obfuscate auto_increment primary keys in databases when they are visible to users in URIs or API calls.
The users should not be able to increment the id in the URL and see the next data record in the database table.