base64.js 264 B

123456789101112
  1. function decodeBase64 (base64) {
  2. return Buffer.from(base64, 'base64').toString('utf8')
  3. }
  4. function encodeBase64 (string) {
  5. return Buffer.from(string, 'utf8').toString('base64')
  6. }
  7. module.exports = {
  8. decodeBase64: decodeBase64,
  9. encodeBase64: encodeBase64
  10. }