This commit is contained in:
Andreas Rumpf 2019-06-03 08:46:57 +02:00 • committed by GitHub
commit a68fe3d082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -122,6 +122,9 @@
- ``case object`` branch transitions via ``system.reset`` are deprecated. - ``case object`` branch transitions via ``system.reset`` are deprecated.
Compile your code with ``-d:nimOldCaseObjects`` for a transition period. 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 #### Breaking changes in the compiler

View file

@ -110,7 +110,7 @@ template encodeInternal(s: typed, lineLen: int, newLine: string): untyped =
#assert(r == result.len) #assert(r == result.len)
discard 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 ## Encodes ``s`` into base64 representation. After ``lineLen`` characters, a
## ``newline`` is added. ## ``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=" assert encode([1, 2, 3, 4, 5]) == "AQIDBAU="
encodeInternal(s, lineLen, newLine) 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 ## Encodes ``s`` into base64 representation. After ``lineLen`` characters, a
## ``newline`` is added. ## ``newline`` is added.
## ##