encodeMIME should be encodeMime by our coding guidelines
This commit is contained in:
parent
fd202136b4
commit
48213c7428
1 changed files with 3 additions and 3 deletions
|
|
@ -182,9 +182,9 @@ proc encode*(s: string, safe = false): string =
|
||||||
assert encode("Hello World") == "SGVsbG8gV29ybGQ="
|
assert encode("Hello World") == "SGVsbG8gV29ybGQ="
|
||||||
encodeImpl()
|
encodeImpl()
|
||||||
|
|
||||||
proc encodeMIME*(s: string, lineLen = 75, newLine = "\r\n"): string =
|
proc encodeMime*(s: string, lineLen = 75, newLine = "\r\n"): string =
|
||||||
## Encodes ``s`` into base64 representation as lines.
|
## Encodes ``s`` into base64 representation as lines.
|
||||||
## Used in email MIME forma, use ``lineLen`` and ``newline``.
|
## Used in email MIME format, use ``lineLen`` and ``newline``.
|
||||||
##
|
##
|
||||||
## This procedure encodes a string according to MIME spec.
|
## This procedure encodes a string according to MIME spec.
|
||||||
##
|
##
|
||||||
|
|
@ -192,7 +192,7 @@ proc encodeMIME*(s: string, lineLen = 75, newLine = "\r\n"): string =
|
||||||
## * `encode proc<#encode,string>`_ for encoding a string
|
## * `encode proc<#encode,string>`_ for encoding a string
|
||||||
## * `decode proc<#decode,string>`_ for decoding a string
|
## * `decode proc<#decode,string>`_ for decoding a string
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
assert encodeMIME("Hello World", 4, "\n") == "SGVs\nbG8g\nV29y\nbGQ="
|
assert encodeMime("Hello World", 4, "\n") == "SGVs\nbG8g\nV29y\nbGQ="
|
||||||
for i, c in encode(s):
|
for i, c in encode(s):
|
||||||
if i != 0 and (i mod lineLen == 0):
|
if i != 0 and (i mod lineLen == 0):
|
||||||
result.add(newLine)
|
result.add(newLine)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue