There is something odd with the output line length setting for base64 encoding. 
The statements:
    
    
    import strutils, bas64
    echo "+".repeat(57).encode()

and:
    
    
    echo "+".repeat(58).encode()

work fine resulting in one or two output lines, but writing:
    
    
    echo "+".repeat(57).encode(LineLen = 76)

crashes although:
    
    
    echo "+".repeat(57).encode(LineLen = 75)

works. Now 75 is the documented default line width excluding CRLF. But counting 
the output I get 76 characters.

Now, trying:
    
    
    echo "+".repeat(30).encode(40)

also crashes (note 30 * 4 == 40 * 3 which relates to the code expansion rate). 
Is it a bug or did I get something wrong?

Reply via email to