official solution to exercise 2 does not pass
Hello,
When I use the official solution which looks like this :
var bytes = [0, 15, 24, 3, 250, 83]
var buff = new Buffer(bytes)
console.log(buff.toString('hex'))
I see this output:
Your submission results compared to the expected:
ACTUAL EXPECTED
────────────────────────────────────────────────────────────────────────────────
"000f1803fa53" != "7c11bcb6d2"
"" == ""
────────────────────────────────────────────────────────────────────────────────
✗ Submission results match expected
# FAIL
Your solution to Hexadecimal Encoding didn't pass. Try again!
nodejs version : v0.10.32 workshop version : [email protected]
Roelof
Hey @roelof1967,
There seems to be some misconception here.
The code you pasted in is not the official solution. The official solution takes numbers from process.argv[2], as described in the problem text. Here is the official solution (well, it used to rely on parseInt instead of Number, but the overall logic is the same):
var bytes = process.argv.slice(2).map(Number)
console.log(new Buffer(bytes).toString('hex'))
The code you pasted definitely displays the value you listed as "actual." But because the solution runner uses random bytes on each run, there's no way static values in the code will match!
Hope this helps.
@maxogden this is closable.
@tdd , @maxogden did not finish his task!