It's actually very easy to implement if all you want is just shortening and you have the slightest idea about databases. All you need to do is generate a random string (functions that do this for almost any language are available online), save that string and the long URL to the database.
If you want tracking and statistics though, it gets more complicated. The simple version can be a good way to get into web development now that I think about it. You learn about forms, GET/POST, databases, very basic SQL etc.
If all you need to do is to "hide" the parameters, you can just use a subdomain of your choice regardless of the length, like post.domain.com or a.domain.com. However, if you want an actual "shortened" url, you will need a short domain name. Shorteners use TLDs other than .com to make it even shorter. For example, reddit.com uses redd.it for short urls.