From a98afb71877e19f3ec4af50f7c735f090c84880c Mon Sep 17 00:00:00 2001 From: mpmckenna8 Date: Mon, 27 Feb 2017 18:15:28 -0800 Subject: [PATCH 1/3] Fixed the solution to the first exercise so that it doesn't use the deprecated way to make buffers so people trying to learn about this stuff aren't given a deprecate example as a good solution. --- exercises/buffer_from_string/solution/solution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/buffer_from_string/solution/solution.js b/exercises/buffer_from_string/solution/solution.js index d9f7d90..6df77da 100644 --- a/exercises/buffer_from_string/solution/solution.js +++ b/exercises/buffer_from_string/solution/solution.js @@ -1 +1 @@ -console.log(new Buffer('bytewiser')) +console.log(Buffer.from('bytewiser')) From 3a57ebe7be88dd6137da96e24f315365ad2342ed Mon Sep 17 00:00:00 2001 From: mpmckenna8 Date: Sat, 27 May 2017 15:14:55 -0700 Subject: [PATCH 2/3] Solution for exercise 2 replacing the deprecated way of creating buffers. --- exercises/hexadecimal_encoding/solution/solution.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/hexadecimal_encoding/solution/solution.js b/exercises/hexadecimal_encoding/solution/solution.js index d09ed19..cc8c53b 100644 --- a/exercises/hexadecimal_encoding/solution/solution.js +++ b/exercises/hexadecimal_encoding/solution/solution.js @@ -1,2 +1,2 @@ -var bytes = process.argv.slice(2).map(Number) -console.log(new Buffer(bytes).toString('hex')) +let bytes = Buffer.from(process.argv.slice(2).map(Number)); +console.log(buff.toString('hex')); From 4bb30d2e4d7b8481dfe25ce705c83e1814aab152 Mon Sep 17 00:00:00 2001 From: mpmckenna8 Date: Sun, 28 May 2017 09:40:26 -0700 Subject: [PATCH 3/3] Updated solution to hexidecimal encoding exercise to use the non deprecated way of making a new node buffer. --- exercises/hexadecimal_encoding/solution/solution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/hexadecimal_encoding/solution/solution.js b/exercises/hexadecimal_encoding/solution/solution.js index d09ed19..8714268 100644 --- a/exercises/hexadecimal_encoding/solution/solution.js +++ b/exercises/hexadecimal_encoding/solution/solution.js @@ -1,2 +1,2 @@ var bytes = process.argv.slice(2).map(Number) -console.log(new Buffer(bytes).toString('hex')) +console.log(Buffer.from(bytes).toString('hex'))