You can write the basics of that sort of thing from start to finish in half a day - easy stuff. You need:
1) Database table to store the "codes" - two "main" columns: Code, DestinationUrl
2) Random code generator to generate the "Code"
That's really the gist of it.