Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 18:14:33 +02:00
parent 52487bd328
commit 9acb7dadc1
3 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,8 @@ lastUpdated: 2020-09-15T16:28:04+03:00
Decodes a string of data which has been encoded using base-64 encoding.
- Create a `Buffer` for the given string with base-64 encoding and use `Buffer.toString('binary')` to return the decoded string.
- Create a `Buffer` for the given string with base-64 encoding.
- Use `Buffer.prototype.toString()` to return the decoded string.
```js
const atob = str => Buffer.from(str, 'base64').toString('binary');

View File

@ -7,7 +7,8 @@ lastUpdated: 2020-09-15T16:28:04+03:00
Creates a base-64 encoded ASCII string from a String object in which each character in the string is treated as a byte of binary data.
- Create a `Buffer` for the given string with binary encoding and use `Buffer.toString('base64')` to return the encoded string.
- Create a `Buffer` for the given string with binary encoding.
- Use `Buffer.prototype.toString()` to return the base-64 encoded string.
```js
const btoa = str => Buffer.from(str, 'binary').toString('base64');

View File

@ -8,8 +8,8 @@ lastUpdated: 2020-10-22T20:24:04+03:00
Returns an array of lines from the specified file.
- Use `fs.readFileSync()` to create a `Buffer` from a file.
- Convert buffer to string using `Buffer.toString(encoding)` function.
- Use `String.prototype.split('\n')` to create an array of lines from the contents of the file.
- Use `Buffer.prototype.toString()` to covert the buffer to a string.
- Use `String.prototype.split()` to create an array of lines from the contents of the file.
```js
const fs = require('fs');