0

I have took many HTML/CSS/JS Classes, but none have explained to me about anything I'm asking now. In the most basic terms I want to know how to make Specific Letters/Symbols Overwrite letters/Symbols in the input and output the leftover string, basically trying to make my own "Custom Base64 Encoder" but I don't exactly know where to start. I have my custom Strings to replace all the letters numbers and basic symbols, (Im using my own Custom ASCII Strings.) but like I said, whats a simple way I can make 1-5 length strings replace numbers/letters/symbols and then do the reverse to also Decode them? Its for a personal project.

Ive tried using a Manual Base64 encoder/decoder and editing the code, but most simply use atob or similar functions.

Also I haven't started with the Code, I'm truly not sure where to start.

I Haven't had any successful results at making a simple custom encoder/decoder.

EDIT: This is the Encoder File (View as .txt file or it may look wierd): Place it in URL Bar

data:text/plain;base64,YSBTUEFDRSBzZXBlcmF0ZXMgZWFjaCBFbmNvZGVkIENoYXJhY3Rlcg0KRmlyc3QgbGluZSBPcmlnaW5hbA0KU2Vjb25kIGlzIEVuY29kZWQNCg0KU3BhY2UgaXMgZW5jb2RlZCBhcyAjDQoNCkEgQiBDIEQgRSBGIEcgSCBJIEogSyBMIE0gTiBPIFAgUSBSIFMgVCBVIFYgVyBYIFkgWiANClAgTyBJIFUgWSBUIFIgRSBXIFEgQSBTIEQgRiBHIEggSiBLIEwgWiBOIEIgViBDIFggTQ0KDQphIGIgYyBkIGUgZiBnIGggaSBqIGsgbCBtIG4gbyBwIHEgciBzIHQgdSB2IHcgeCB5IHogMSAyIDMgNCA1IDYgNyA4IDkgMA0KcCBvIGkgdSB5IHQgciBlIHcgcSBhIHMgZCBmIGcgaCBqIGsgbCB6IG4gYiB2IGMgeCBtIDkgMyAxIDggNCA3IDIgMCA1IDYNCg0KIC0gID0gIFsgICAgXSAgIFwgICA7ICAgICAnICAgICwgICAgLiAgIC8gICBgICAgfiAgICEgICBAICAjICAgJCAgJSAgIF4gICAmICAqICAgKCAgICAgKSAgXyAgICsgICAgeyAgICB9ICAgIHwgICAgOiAgICAiICAgIDwgICAgPiAgICA/DQoxMiAxNSAxNyAxOSAyMSAyNSAyOCAzMiAzNSAzNiAzOCA0MSA0MyA0NyA1MCA1MyA1NCA1NyA1OSA2MSA2NSA2OCA3MyA3NiA4MiA4NCA4OSA5NiA5NyAxMDIgMTA0IDEwOQ0KDQoNCg0KDQoNCg==

  • 1
    As it stands, this question is too broad. The full answer to "how do I make my decoder/encoder" is going to be rather long. The short answer will be along the lines of "just implement the algorithm" but that's rather useless to you. You should break down what you need, try your hand at doing each thing and come back with more concrete questions if you get stuck. – VLAZ Jan 24 '19 at 14:02
  • 1
    This might be relevant https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript – Saraband Jan 24 '19 at 14:07
  • THIS ISNT A DUPLICATE, Im asking for a Custom encoder –  Jan 24 '19 at 14:13
  • @SkylerSpark I've made a [jsfiddle](http://jsfiddle.net/Robb216/upf5m308/37/) of a custom base64 encoder, if you're still interested. Was already halfway done when the question got closed! – Robb216 Jan 24 '19 at 15:04
  • Sigh, well atleast soemthing came out of it :) thanks, unfortunately, I just dont feel welcome here anymore. so I probably wont ask anymore questions. –  Jan 24 '19 at 16:45
  • @Robb216 is there a way to reverse Decode this? that would be awesome too, like Would I just reverse that alphabet and get a decoded version? –  Jan 24 '19 at 16:51
  • Man I really am a code noob, I literally reversed it and now it just outputs Random Numbers and stuff. –  Jan 24 '19 at 17:00
  • @SkylerSpark Don't be too hard on yourself :) Make sure to read the wiki article about base64 so you understand what's going on. I added the decoder function to the [jsfiddle](https://jsfiddle.net/Robb216/upf5m308/). However, since javascript uses UTF16 (actually UCF2) for strings, the function cannot decode the UTF8 base64 string in the example in your question. You'll need a UTF16 - UTF8 converter to do that. Let me know if you have any more questions! – Robb216 Jan 25 '19 at 09:10
  • Will do, Apologies for outright getting frustrated, I don't usually get much positive activity on my answers here :( –  Jan 25 '19 at 13:24

0 Answers0