Author: Jay Taylor
Date: 2019-07-08
Purpose: Created as a C++ reference for SO: How do I create a URL shortener?.
How to obtain, compile, and run this code.
curl -O https://gist.githubusercontent.com/jaytaylor/a11fadf61a869ade0dfe568606b216c8/raw/dc859441178cd62ee83811e93c36267ce9fc4f4d/base64-url-shortener-poc.cpp
g++ -o base64-url-shortener-poc base64-url-shortener-poc.cpp
./base64-url-shortener-poc 99592
./base64-url-shortener-poc 99592
Input ID: 99592
---
Generated short URL: z4u
ID decoded from URL: 99592
Originally based on this code.
- Accepts input ID from the command-line.
- Meaningful comments.
- Better Readability: More conventional C++ coding style.
- Removed unnecessary type complexity.