summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/std/sha1.nim27
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/std/sha1.nim b/lib/std/sha1.nim
index b74b285f8..9c5efed1f 100644
--- a/lib/std/sha1.nim
+++ b/lib/std/sha1.nim
@@ -6,33 +6,26 @@
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
 #
-## **Note:** Import `std/sha1` to use this module.
-##
 ## [SHA-1 (Secure Hash Algorithm 1)](https://en.wikipedia.org/wiki/SHA-1)
 ## is a cryptographic hash function which takes an input and produces
 ## a 160-bit (20-byte) hash value known as a message digest.
 ##
-## Basic usage
-## ===========
-##
-runnableExamples:
-  let accessName = secureHash("John Doe")
-  assert $accessName == "AE6E4D1209F17B460503904FAD297B31E9CF6362"
-
-## .. code-block::
-##   let
-##     a = secureHashFile("myFile.nim")
-##     b = parseSecureHash("10DFAEBF6BFDBC7939957068E2EFACEC4972933C")
-##
-##   if a == b:
-##     echo "Files match"
-##
 ## See also
 ## ========
 ## * `base64 module<base64.html>`_ implements a Base64 encoder and decoder
 ## * `hashes module<hashes.html>`_ for efficient computations of hash values for diverse Nim types
 ## * `md5 module<md5.html>`_ implements the MD5 checksum algorithm
 
+runnableExamples:
+  let accessName = secureHash("John Doe")
+  assert $accessName == "AE6E4D1209F17B460503904FAD297B31E9CF6362"
+
+runnableExamples("-r:off"):
+  let
+    a = secureHashFile("myFile.nim")
+    b = parseSecureHash("10DFAEBF6BFDBC7939957068E2EFACEC4972933C")
+  assert a == b, "files don't match"
+
 import std/strutils
 from std/endians import bigEndian32, bigEndian64
 
id='n145' href='#n145'>145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216