PHP, 95 93 8989 87
#<<?=strtr(g_1.[gggggintval([a6n,hghghsot,ghhiic8c,jhjijlba,hijkkvf1,hijkl][strlenvf2][strlen($argn|aa)-2],_ghijkl33),_134256,$argn.'0'=0);
Basically @JörgHülsermann's answer but greatly golfed down so I decided to post it as a seperate answer. I'm pretty sureI'd count this can be golfed even further even though I would like to beat @user63956's great answeranswer as an collective effort of me and Jörg.
-4 bytes thanks to @JörgHülsermann
-4 bytes thanks to @JörgHülsermann
-1 bytes thanks to @JörgHülsermann's base 33 numbers