Skip to content

Instantly share code, notes, and snippets.

@berkes
Created Oct 8, 2021
Embed
What would you like to do?
URL shortner without storage
<?php
composer require "tuupola/base85:^1.0"
$url = "https://ultimatemotherfuckingwebsite.com/"
$base85 = new Tuupola\Base85;
$tokenized = $base85->encode($url);
$shortened = "https://big.pm/$tokenized";
print("The URL $url, is shorthened to $shortened");
$long = array_pop(explode('/', $shortened));
print("redirecting to: $long")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment