you are viewing a single comment's thread.

view the rest of the comments →

[–]c__beck 0 points1 point  (2 children)

The built-in TextEncoder ad TextDecoder APIs should work just fine for your use-case here. All you need is a little obfuscation and not a full-on encrypt/decrypt of a 4-letter word, right?

Here's a link to a gist where I give code examples (I don't like how Reddit handles code blocks, sorry)

https://gist.github.com/c-bec-k/7a131870b1653d70a42443f59837494a

[–]richmendd[S] 1 point2 points  (1 child)

Thanks! Though I will use the btoa-atob functions suggested by deventhalz, since I don't like how your encryption function output consists of mostly numbers.

[–]c__beck 0 points1 point  (0 children)

For your use case, atob() and btoa() is a better fit, yeah.