-
Notifications
You must be signed in to change notification settings - Fork 75
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
base: main
Are you sure you want to change the base?
Conversation
…ame of a function referenced earlier
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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".
These edits should be mostly non-controversial.
_calc_index
which is probably incorrect.Lastly, I assign the copyright of this contribution to Pedro Duarte Faria.