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
console.log(base64)
assert.equal(base64, Buffer.from([
89,110,86,109,90,109,86,121,99,
121,66,104,99,109,85,103,98,109,
86,104,100,65,61,61]))
console.log('passed!')
2
Comments
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.