Created
October 5, 2018 11:28
-
-
Save odykyi/5cf48a46c6dfdcb29cddb95f172fd030 to your computer and use it in GitHub Desktop.
base64 strings join concat nodejs
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
function joinBase64Strings(base64Str1, base64Str2) { | |
const bothData = Buffer.from(base64Str1, 'base64').toString('binary') + Buffer.from(base64Str2, 'base64').toString('binary'); | |
const joinedBase64Result = Buffer.from(bothData.toString(), 'binary').toString('base64'); | |
console.log('joinedBase64Result', joinedBase64Result); | |
return joinedBase64Result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment