[backport] run nimpretty on hashes
This commit is contained in:
parent
b17ed2ca9c
commit
15895ebc3f
5 changed files with 16 additions and 12 deletions
|
|
@ -112,7 +112,8 @@ 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=""): 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.
|
||||
##
|
||||
|
|
@ -128,7 +129,7 @@ proc encode*[T: SomeInteger|char](s: openArray[T], lineLen = 75, newLine=""): st
|
|||
assert encode([1, 2, 3, 4, 5]) == "AQIDBAU="
|
||||
encodeInternal(s, lineLen, newLine)
|
||||
|
||||
proc encode*(s: string, lineLen = 75, newLine=""): string =
|
||||
proc encode*(s: string, lineLen = 75, newLine = ""): string =
|
||||
## Encodes ``s`` into base64 representation. After ``lineLen`` characters, a
|
||||
## ``newline`` is added.
|
||||
##
|
||||
|
|
@ -208,5 +209,5 @@ when isMainModule:
|
|||
|
||||
for t in items(tests):
|
||||
assert decode(encode(t)) == t
|
||||
assert decode(encode(t, lineLen=40)) == t
|
||||
assert decode(encode(t, lineLen=76)) == t
|
||||
assert decode(encode(t, lineLen = 40)) == t
|
||||
assert decode(encode(t, lineLen = 76)) == t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue