avoid deprecated procs
This commit is contained in:
parent
b69598a64a
commit
a3f80c4bdf
2 changed files with 3 additions and 3 deletions
|
|
@ -81,7 +81,7 @@ proc parsePath(uri: string, i: var int, result: var Uri) =
|
||||||
i.inc parseUntil(uri, result.path, {'?', '#'}, i)
|
i.inc parseUntil(uri, result.path, {'?', '#'}, i)
|
||||||
|
|
||||||
# The 'mailto' scheme's PATH actually contains the hostname/username
|
# The 'mailto' scheme's PATH actually contains the hostname/username
|
||||||
if result.scheme.toLower == "mailto":
|
if cmpIgnoreCase(result.scheme, "mailto") == 0:
|
||||||
parseAuthority(result.path, result)
|
parseAuthority(result.path, result)
|
||||||
result.path.setLen(0)
|
result.path.setLen(0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -588,13 +588,13 @@ proc md5*(d: ptr cuchar; n: csize; md: ptr cuchar): ptr cuchar{.importc: "MD5".}
|
||||||
proc md5_Transform*(c: var MD5_CTX; b: ptr cuchar){.importc: "MD5_Transform".}
|
proc md5_Transform*(c: var MD5_CTX; b: ptr cuchar){.importc: "MD5_Transform".}
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
from strutils import toHex,toLower
|
from strutils import toHex, toLowerAscii
|
||||||
|
|
||||||
proc hexStr (buf:cstring): string =
|
proc hexStr (buf:cstring): string =
|
||||||
# turn md5s output into a nice hex str
|
# turn md5s output into a nice hex str
|
||||||
result = newStringOfCap(32)
|
result = newStringOfCap(32)
|
||||||
for i in 0 .. <16:
|
for i in 0 .. <16:
|
||||||
result.add toHex(buf[i].ord, 2).toLower
|
result.add toHex(buf[i].ord, 2).toLowerAscii
|
||||||
|
|
||||||
proc md5_File* (file: string): string {.raises: [IOError,Exception].} =
|
proc md5_File* (file: string): string {.raises: [IOError,Exception].} =
|
||||||
## Generate MD5 hash for a file. Result is a 32 character
|
## Generate MD5 hash for a file. Result is a 32 character
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue