base64 encoding .txt file

for me it looks reasonable, because it works! now for me good is what works and if there are some mistakes i would like to hear what mistakes i have made.