Skip to content

Instantly share code, notes, and snippets.

@odykyi
Created October 5, 2018 11:28
Show Gist options
  • Save odykyi/5cf48a46c6dfdcb29cddb95f172fd030 to your computer and use it in GitHub Desktop.
Save odykyi/5cf48a46c6dfdcb29cddb95f172fd030 to your computer and use it in GitHub Desktop.
base64 strings join concat nodejs
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