summary refs log tree commit diff stats
path: root/lib/pure/md5.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-07-10 12:42:23 +0200
committerAraq <rumpf_a@web.de>2019-07-10 12:42:41 +0200
commitc94647aecad6ed7fd12152800437a6cda11e06e6 (patch)
treef876ae0ac6379dfd99fd5d5ed7d8903be96b433b /lib/pure/md5.nim
parent96523cdd3e8ada367b804efbd47f4763a1269fa8 (diff)
downloadNim-c94647aecad6ed7fd12152800437a6cda11e06e6.tar.gz
styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error
Diffstat (limited to 'lib/pure/md5.nim')
-rw-r--r--lib/pure/md5.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pure/md5.nim b/lib/pure/md5.nim
index ae8e12707..b6f814b88 100644
--- a/lib/pure/md5.nim
+++ b/lib/pure/md5.nim
@@ -15,6 +15,9 @@
 ## * `hashes module<hashes.html>`_ for efficient computations of hash values
 ##   for diverse Nim types
 
+when defined(nimHasStyleChecks):
+  {.push styleChecks: off.}
+
 type
   MD5State = array[0..3, uint32]
   MD5Block = array[0..15, uint32]
@@ -197,7 +200,7 @@ proc `$`*(d: MD5Digest): string =
     add(result, digits[d[i].int and 0xF])
 
 proc getMD5*(s: string): string =
-  ## Computes an MD5 value of `s` and returns its string representation. 
+  ## Computes an MD5 value of `s` and returns its string representation.
   ## .. note::
   ## available at compile time
   ##
@@ -232,7 +235,7 @@ proc md5Init*(c: var MD5Context) =
   c.state[3] = 0x10325476'u32
   c.count[0] = 0'u32
   c.count[1] = 0'u32
-  zeroMem(addr(c.buffer), sizeof(MD5buffer))
+  zeroMem(addr(c.buffer), sizeof(MD5Buffer))
 
 proc md5Update*(c: var MD5Context, input: cstring, len: int) =
   ## Updates the `MD5Context` with the `input` data of length `len`.
@@ -280,3 +283,6 @@ when isMainModule:
   assert(getMD5("Frank jagt im komplett verwahrlosten Taxi quer durch Bayern") ==
     "7e716d0e702df0505fc72e2b89467910")
   assert($toMD5("") == "d41d8cd98f00b204e9800998ecf8427e")
+
+when defined(nimHasStyleChecks):
+  {.pop.} #{.push styleChecks: off.}