Skip to content

Commit

Permalink
Merge pull request #11 from cgay/dev
Browse files Browse the repository at this point in the history
Update doc and package patch version number
  • Loading branch information
cgay authored May 13, 2024
2 parents 271d1da + 1419d79 commit 3aef6e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# "<project> v<release> documentation".
html_title = "Hash Algorithms"

html_theme = 'furo'
html_theme = 'furo' # https://pradyunsg.me/furo/customisation/

# Ignore certification verification
tls_verify = False
26 changes: 13 additions & 13 deletions documentation/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
***************************
The hash-algorithms Library
***************************
***************
hash-algorithms
***************

.. current-library:: hash-algorithms
.. current-module:: hash-algorithms
Expand All @@ -20,13 +20,14 @@ after each hash:

.. code-block:: dylan
let digest = sha1("Some text");
sha1("Some text"); // => {<simple-byte-vector> sequence 2, 217, 44, 88, 13, 78, ... }
If you want a printable digest, use :meth:`hexdigest(<byte-vector>)`:

.. code-block:: dylan
let hexdigest = hexdigest(sha1("Some text"));
hexdigest(sha1("Some text"))
// => "02D92C580D4EDE6C80A878BDD9F3142D8F757BE8"
If you want to hash multiple strings into a single digest (useful when streaming),
you can use the :gf:`update-hash` and :gf:`digest` functions:
Expand All @@ -37,9 +38,8 @@ you can use the :gf:`update-hash` and :gf:`digest` functions:
update-hash(hash, "Some");
update-hash(hash, " ");
update-hash(hash, "text");
let digest = digest(hash);
// hexdigest works on hashes as well:
let hexdigest = hexdigest(hash);
digest(hash); // => {<simple-byte-vector> sequence 2, 217, 44, 88, 13, 78, 222, ...}
hexdigest(hash); // => "EA1C208EFBF629C89F52D165045B1716EA8EB012"
The hash-algorithms Module
==========================
Expand Down Expand Up @@ -80,7 +80,7 @@ The hash-algorithms Module
Add more data to the hash. This is useful when streaming data or the data is
available in multiple strings and you wish to avoid the overhead of concatenation.

Calling ``update-hash`` multiple times is equivalent to calling it once with
Calling :gf:`update-hash` multiple times is equivalent to calling it once with
a concatenation of the arguments:

.. code-block:: dylan
Expand All @@ -89,13 +89,13 @@ The hash-algorithms Module
update-hash(hash-separate, "Some");
update-hash(hash-separate, " ");
update-hash(hash-separate, "text");
let digest-separate = digest(hash-separate);
digest(hash-separate);
// => {<simple-byte-vector> sequence 2, 217, 44, 88, 13, 78, 222, ... }
let hash-combined = make(<sha1>);
update-hash(hash-combined, "Some text");
let digest-combined = digest(hash-combined);
// digest-separate and digest-combined will be the same
digest(hash-combined);
// => {<simple-byte-vector> sequence 2, 217, 44, 88, 13, 78, 222, ... }
:seealso:

Expand Down
5 changes: 3 additions & 2 deletions dylan-package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"description": "SHA-1 and SHA-2 hashing",
"name": "hash-algorithms",
"version": "1.1.0",
"version": "1.1.1",
"dependencies": [],
"dev-dependencies": [
"sphinx-extensions",
"testworks"
],
"url": "https://github.com/dylan-lang/hash-algorithms"
"url": "https://github.com/dylan-lang/hash-algorithms",
"license-url": "https://github.com/dylan-lang/hash-algorithms/blob/master/LICENSE"
}

0 comments on commit 3aef6e4

Please sign in to comment.