Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc and package patch version number #11

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}