I want to write a tinyurl clone, and take text like:
https://myfunwebsite.com/coolthing
and shorten that string to something like:
asdf9SDFs23vbk
I have the following code:
const buffer = zlib.deflateSync(myString);
const compressed = buffer.toString('ascii');
But the problem is it creates a string like x?K())0RWOHMII/O/JIQKL??O???
which is bad for putting into url params. I want the resulting string to only be letters and numbers, how do I do this?