Use builting base encoding & Fixed warnings

@TokyoBirdy Please take a look and see if it does what it's supposed to.