@@ -14,7 +14,7 @@ const defaultBufSize = 16 * 1024
1414
1515// size of the byte chunk whose base is converted at a time when the length of the character
1616// set is not a power of 2. See NewCoding for more detail.
17- const defaultNonPow2ByteChunkSize = 8
17+ const defaultNonPow2ByteChunkSize = 4
1818
1919// sliceByteLen slices the byte b such that the result has length len and starting bit start
2020func sliceByteLen (b byte , start uint8 , len uint8 ) byte {
@@ -177,7 +177,7 @@ type Coding interface {
177177//
178178// This is because most encoders interpret data as a number and use a base conversion algorithm to convert it to the
179179// character set. For non-power-of-2 charsets, this requires all data to be read before encoding, which is not possible
180- // with streams. To enable stream encoding for non-power-of-2 charsets, Aces converts a default of 8 bytes (adjustable
180+ // with streams. To enable stream encoding for non-power-of-2 charsets, Aces converts a default of 4 bytes (adjustable
181181// with Coding.SetByteChunkSize) of data at a time, which is not the same as converting the base of the entire data.
182182func NewCoding (charset []rune ) (Coding , error ) {
183183 seen := make (map [rune ]bool )
@@ -329,9 +329,9 @@ func (c *anyCoding) Encode(dst io.Writer, src io.Reader) error {
329329
330330var resultBuf = make ([]rune , 0 , 64 )
331331
332- func encodeByteChunk (set []rune , octet []byte , rPerChunk int ) []rune {
332+ func encodeByteChunk (set []rune , chunk []byte , rPerChunk int ) []rune {
333333 resultBuf = resultBuf [:0 ]
334- i := bytesToInt (octet )
334+ i := bytesToInt (chunk )
335335 resultBuf = toBase (i , resultBuf , set )
336336 //return append([]rune(strings.Repeat(string(set[0]), rPerChunk-len(resultBuf))), resultBuf...)
337337 for len (resultBuf ) < rPerChunk {
0 commit comments