Welcome to the Linux Foundation Forum!

Unable to solve ch-11 > labs-2

'use strict'
const assert = require('assert')
const str = 'buffers are neat'
const base64 = Buffer.from(str, 'base64') // convert str to base64


assert.equal(base64, Buffer.from([



  • nayibnayib Posts: 4

    The challenge state is "Convert a String to base64 Encoded String by Using a Buffer". The result for this challenge is "YnVmZmVycyBhcmUgbmVhdA==" given the string "buffers are neat" . Taking this into account there might be a mistake either in the challenge statement or the assertion .

    Looking forward to getting an answer from @davidmarkclements

  • Im stuck on this one too

  • Hello, I can confirm this pass with 0 errors. If you want the solution =>

    const base64 = Buffer.from(str).toString('base64');

  • @xwarzdev is correct.

  • Thanks to teacher David, and @xwarzdev.
    The string was transfered to base64.

Sign In or Register to comment.