<html><body>
<a download="9dksk239xwd.txt" id="test" href="#">test</a>
<script type="application/javascript">
var type = 'data:application/octet-stream;base64, ';
var text = 'jxowsjsivneic';
var base = btoa(text);
var res = type + base;
document.getElementById('test').href = res;
</script>
</body></html>