URL shortener algorithm.
You must add this file in your project.
Mod62.php // for PHP
Mod62.js // for JavaScript
Mod62.py // for Python
If you want test on your project use to Mod62 API Branch.
# for PHP
$mod62coder = new Mod62(); // Create new instance
echo $mod62coder->encode(46999); // encode 46999 to mod62
echo $mod62coder->decode('ba'); // decode ba to 46999
// for JavaScript
let mod62coder = new Mod62(); // Create new instance
mod62coder.girdi = 46999;
console.log(mod62coder.encode()); // encode 46999 to mod62
mod62coder.girdi = "ba";
console.log(mod62coder.decode()); // decode ba to 46999
# for Python
mod62coder = Mod62() # Create new instance
print(mod62coder.encode(46999)) # encode 46999 to mod62
print(mod62coder.decode("ba")) # decode ba to 46999
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.