Hi, it’s @okboomer1234321 on a different account. By any chance would anyone know a way to code something to encode text and decode text?
Do you mean base64?
You should check out encodeURIComponent.
AND NOW I AM A REGULAR!!!
@RiversideRocks behold i have the gray text next to my name too.
Hi! It depends what you mean when you say ‘encode’:
- To ‘cipher’ - make the contents secret using simple tricks and substitutions?
- To ‘encode’ is to use a different set of characters to represent the same content in a predictable way (base64 and url encoding are both examples)
- To ‘encrypt’ is to make the content secret using a reversible algorithm (decryption)
It depends what you’re trying to achieve. So can you tell us why you want to encode your text?
Just want to encode it so random people can’t see the messages but someone that has the website can.
This would probably be your option then.
I’ve got a feeling that https does what you want and you don’t need to do anything special. When you access a website via https, everything you send and receive is encrypted in transit, so no-one can snoop on what you’re sending.
I suspect you don’t need to do anything.
If you want to encrypt messages (for fun) you could look at this tutorial: How to encrypt and decrypt data in Node.js
And the Node.js docs for lib/crypto: Crypto | Node.js v21.2.0 Documentation
HTH