Last active
June 11, 2017 13:53
-
-
Save craigayre/c1bc2abbb9335e46c567bb931e6f05af to your computer and use it in GitHub Desktop.
This file contains 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
d=>{for(a=e=b=0,c='';a<((4*d.length+2)/3|0);c+=`${x='ABCDEFGHIJKLMNOPQRSTUVWXYZ'}${x.toLowerCase()}0123456789+/`[b>>2*(++a&3)&63])a&3^3&&(b=b<<8^d[e++]);while(a++&3)c+="=";return c} |
Use arrow function notation
Use template literals for lowercase alphabet
Use default parameters when assigning a
- removes semicolon
Remove args as parameters since they're assigned inside first for loop. Move c assignment so that parens aren't needed for arrow function since only one param
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add initial solution