sasl base64 encode decode fix

This fix make encode/decode work and adds a test case too.
Why create a byte array here? Just changing appendNumber->append should work.