(str)
| 4456 | } |
| 4457 | |
| 4458 | function thisAtob(str) { |
| 4459 | var base64 = Buffer.from(str, 'base64'); |
| 4460 | // Node.js will just skip the characters it can't decode instead of |
| 4461 | // throwing an exception |
| 4462 | if (base64.toString('base64') !== str) { |
| 4463 | throw new Error("attachment is not a valid base64 string"); |
| 4464 | } |
| 4465 | return base64.toString('binary'); |
| 4466 | } |
| 4467 | |
| 4468 | function thisBtoa(str) { |
| 4469 | return Buffer.from(str, 'binary').toString('base64'); |