Created
May 25, 2022 00:34
-
-
Save myfonj/dce1c1c3470946dd36678353197b7316 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(str='Hello world!') | |
.map(_=>_.codePointAt(0).toString(2).padStart(8,'0')) | |
.join('') | |
.match(/\d{1,6}/g) | |
.map(_=>_.padEnd(6,'0')) | |
.map(_=>parseInt(_,2)) | |
//.map(_=>{console.log(_);return _}) | |
.map(_=>Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')[_]) | |
.join('') + ' ' + btoa(str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment