Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 4 grammar and typos #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

deweyx
Copy link

@deweyx deweyx commented Mar 7, 2025

These edits should be mostly non-controversial.

  • I noticed the reference to _calc_index which is probably incorrect.
  • It would be nice to converge on American- or British-style spellings. This chapter includes both "summarise" and "summarize". One of these edits changes the plurality, but I left the spelling as is.

Lastly, I assign the copyright of this contribution to Pedro Duarte Faria.

@@ -58,18 +58,18 @@ Each index in this scale is represented by a character (it's a scale of 64 chara
So, in order to convert some binary data, to the base64 encoding, we need to convert each binary number to the corresponding
character in this "scale of 64 characters".

The base64 scale starts with all ASCII uppercase letters (A to Z) which represents
the first 25 indexes in this scale (0 to 25). After that, we have all ASCII lowercase letters
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clear off-by-one error 😄

@@ -778,7 +778,7 @@ indexes in `buf` to be converted, and then, we apply the 6-bit transformation
over the temporary buffer.

Notice that we check if the indexes 2 and 3 in the temporary buffer are the number 64, which, if you recall
from @sec-map-base64-index, is when the `_calc_index()` function receives a `'='` character
from @sec-map-base64-index, is when the `_char_index()` function receives a `'='` character
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be referencing _char_index from earlier.

@@ -282,7 +282,7 @@ fn _calc_encode_length(input: []const u8) !usize {
```


Also, you might have notice that, if the input length is less than 3 bytes, then, the output length of the encoder is
Also, you might notice that, if the input length is less than 3 bytes, then, the output length of the encoder is
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If keeping "have" should then be "have noticed".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants