On page 671 ("12.5.1 Base 64 Encoding"), the comment says "There will never be more than 2 padding bytes". However the code says "padding = 3 - (num_initial % 3)" which I suspect should read "padding = 2 - (num_initial % 3)". This is confirmed in the output below where it reads "Expect 3 padding bytes".
On page 671 ("12.5.1 Base 64 Encoding"), the comment says "There will never be more than 2 padding bytes". However the code says "padding = 3 - (num_initial % 3)" which I suspect should read "padding = 2 - (num_initial % 3)". This is confirmed in the output below where it reads "Expect 3 padding bytes".