remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs (#17543)
* remove std/ prefix from doc/lib.rst now that canonical import is shown in module docs * cleanup top docs for std/sha1
This commit is contained in:
parent
89e0e0f27f
commit
04520c0ce4
2 changed files with 23 additions and 30 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue