diff --git a/changelog.md b/changelog.md index c0f1ee0b8e..6c3bc018be 100644 --- a/changelog.md +++ b/changelog.md @@ -122,6 +122,9 @@ - ``case object`` branch transitions via ``system.reset`` are deprecated. Compile your code with ``-d:nimOldCaseObjects`` for a transition period. +- base64 module: The default parameter `newLine` for the `encode` procs + was changed from `"\13\10"` to the empty string `""`. + #### Breaking changes in the compiler diff --git a/lib/pure/base64.nim b/lib/pure/base64.nim index 5985592ff4..0d1839c705 100644 --- a/lib/pure/base64.nim +++ b/lib/pure/base64.nim @@ -110,7 +110,7 @@ template encodeInternal(s: typed, lineLen: int, newLine: string): untyped = #assert(r == result.len) discard -proc encode*[T:SomeInteger|char](s: openarray[T], lineLen = 75, newLine="\13\10"): string = +proc encode*[T:SomeInteger|char](s: openarray[T], lineLen = 75, newLine=""): string = ## Encodes ``s`` into base64 representation. After ``lineLen`` characters, a ## ``newline`` is added. ## @@ -126,7 +126,7 @@ proc encode*[T:SomeInteger|char](s: openarray[T], lineLen = 75, newLine="\13\10" assert encode([1, 2, 3, 4, 5]) == "AQIDBAU=" encodeInternal(s, lineLen, newLine) -proc encode*(s: string, lineLen = 75, newLine="\13\10"): string = +proc encode*(s: string, lineLen = 75, newLine=""): string = ## Encodes ``s`` into base64 representation. After ``lineLen`` characters, a ## ``newline`` is added. ##