-
-

The hash-algorithms Library#

+
+

hash-algorithms#

The hash-algorithms library provides consistent access to a variety of hash algorithms:

    @@ -201,11 +201,12 @@

    The hash-algorithms Library
    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 hexdigest(<byte-vector>):

    -
    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), @@ -214,9 +215,8 @@

    The hash-algorithms Libraryupdate-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"

    @@ -290,19 +290,19 @@

    The hash-algorithms ModuleDiscussion:

    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 update-hash multiple times is equivalent to calling it once with a concatenation of the arguments:

    let hash-separate = make(<sha1>);
     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, ... }
     

    @@ -638,7 +638,7 @@

    SHA-2#
      -
    • The hash-algorithms Library
        +
      • hash-algorithms
        • The hash-algorithms Module
          • MD5
          • SHA-1
          • diff --git a/objects.inv b/objects.inv index 61df00f..cf65ccf 100644 --- a/objects.inv +++ b/objects.inv @@ -2,5 +2,5 @@ # Project: Hash Algorithms # Version: # The remainder of this file is compressed using zlib. -xڭj0~ -A{h*MZbL@ r%*[RJܧ!tηIQlh#Hg(/).ĝ1f;[#$ ]8b#Ke#,\aa4_]73.W0CT+=Pf6AQҞ0~VbpmUfр!Ӳ/IH&z{jٸ6lv|@Lj`$ds(1JѰ~L*4$p2v6P^ ծg 2;rCT}(Mry֛#ۃ} +*nda{ؼbNA% 4bbO,Lm:(j0[!53Tz\ \ No newline at end of file diff --git a/searchindex.js b/searchindex.js index 0813ea6..871967c 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["The hash-algorithms Library"], "terms": {"provid": 0, "consist": 0, "access": 0, "varieti": 0, "sha1": 0, "sha224": 0, "sha256": 0, "sha384": 0, "sha512": 0, "an": 0, "entir": 0, "string": 0, "onc": 0, "can": 0, "done": 0, "via": 0, "function": 0, "name": 0, "after": 0, "each": 0, "let": 0, "digest": 0, "some": 0, "text": 0, "If": 0, "you": 0, "want": 0, "printabl": 0, "us": 0, "hexdigest": 0, "byte": 0, "vector": 0, "multipl": 0, "singl": 0, "when": 0, "stream": 0, "updat": 0, "make": 0, "work": 0, "well": 0, "class": 0, "superclass": 0, "object": 0, "size": 0, "gener": 0, "return": 0, "signatur": 0, "paramet": 0, "instanc": 0, "valu": 0, "integ": 0, "block": 0, "add": 0, "more": 0, "data": 0, "input": 0, "buffer": 0, "discuss": 0, "thi": 0, "i": 0, "avail": 0, "wish": 0, "avoid": 0, "overhead": 0, "concaten": 0, "call": 0, "time": 0, "equival": 0, "argument": 0, "separ": 0, "combin": 0, "same": 0, "see": 0, "also": 0, "binari": 0, "mai": 0, "includ": 0, "null": 0, "To": 0, "displai": 0, "result": 0, "form": 0, "method": 0, "given": 0, "hexadecim": 0}, "objects": {"": [[0, 0, 0, "hash-algorithms:hash-algorithms:[hash]", "<hash>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[md5]", "<md5>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha1]", "<sha1>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha224]", "<sha224>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha256]", "<sha256>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha384]", "<sha384>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha512]", "<sha512>"], [0, 1, 0, "hash-algorithms:hash-algorithms:block-size", "block-size"], [0, 1, 0, "hash-algorithms:hash-algorithms:digest", "digest"], [0, 1, 0, "hash-algorithms:hash-algorithms:digest-size", "digest-size"], [0, 2, 0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])", "hexdigest(<byte-vector>)"], [0, 2, 0, "hash-algorithms:hash-algorithms:hexdigest([hash])", "hexdigest(<hash>)"], [0, 1, 0, "hash-algorithms:hash-algorithms:md5", "md5"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha1", "sha1"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha224", "sha224"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha256", "sha256"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha384", "sha384"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha512", "sha512"], [0, 1, 0, "hash-algorithms:hash-algorithms:update-hash", "update-hash"]]}, "objtypes": {"0": "dylan:class", "1": "dylan:function", "2": "dylan:method"}, "objnames": {"0": ["dylan", "class", "Dylan class"], "1": ["dylan", "function", "Dylan function"], "2": ["dylan", "method", "Dylan method"]}, "titleterms": {"The": 0, "hash": 0, "algorithm": 0, "librari": 0, "modul": 0, "md5": 0, "sha": 0, "1": 0, "2": 0}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 58}, "alltitles": {"The hash-algorithms Library": [[0, "the-hash-algorithms-library"]], "The hash-algorithms Module": [[0, "the-hash-algorithms-module"]], "MD5": [[0, "md5"]], "SHA-1": [[0, "sha-1"]], "SHA-2": [[0, "sha-2"]]}, "indexentries": {"": [[0, "hash-algorithms:hash-algorithms:[hash]"]], "": [[0, "hash-algorithms:hash-algorithms:[md5]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha1]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha224]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha256]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha384]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha512]"]], "block-size": [[0, "hash-algorithms:hash-algorithms:block-size"]], "digest": [[0, "hash-algorithms:hash-algorithms:digest"]], "digest-size": [[0, "hash-algorithms:hash-algorithms:digest-size"]], "hexdigest": [[0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])"], [0, "hash-algorithms:hash-algorithms:hexdigest([hash])"]], "hexdigest()": [[0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])"]], "hexdigest()": [[0, "hash-algorithms:hash-algorithms:hexdigest([hash])"]], "md5": [[0, "hash-algorithms:hash-algorithms:md5"]], "sha1": [[0, "hash-algorithms:hash-algorithms:sha1"]], "sha224": [[0, "hash-algorithms:hash-algorithms:sha224"]], "sha256": [[0, "hash-algorithms:hash-algorithms:sha256"]], "sha384": [[0, "hash-algorithms:hash-algorithms:sha384"]], "sha512": [[0, "hash-algorithms:hash-algorithms:sha512"]], "update-hash": [[0, "hash-algorithms:hash-algorithms:update-hash"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["index"], "filenames": ["index.rst"], "titles": ["hash-algorithms"], "terms": {"librari": 0, "provid": 0, "consist": 0, "access": 0, "varieti": 0, "sha1": 0, "sha224": 0, "sha256": 0, "sha384": 0, "sha512": 0, "an": 0, "entir": 0, "string": 0, "onc": 0, "can": 0, "done": 0, "via": 0, "function": 0, "name": 0, "after": 0, "each": 0, "some": 0, "text": 0, "simpl": 0, "byte": 0, "vector": 0, "sequenc": 0, "217": 0, "44": 0, "88": 0, "13": 0, "78": 0, "If": 0, "you": 0, "want": 0, "printabl": 0, "digest": 0, "us": 0, "hexdigest": 0, "02d92c580d4ede6c80a878bdd9f3142d8f757be8": 0, "multipl": 0, "singl": 0, "when": 0, "stream": 0, "updat": 0, "let": 0, "make": 0, "222": 0, "ea1c208efbf629c89f52d165045b1716ea8eb012": 0, "class": 0, "superclass": 0, "object": 0, "size": 0, "gener": 0, "return": 0, "signatur": 0, "paramet": 0, "instanc": 0, "valu": 0, "integ": 0, "block": 0, "add": 0, "more": 0, "data": 0, "input": 0, "buffer": 0, "discuss": 0, "thi": 0, "i": 0, "avail": 0, "wish": 0, "avoid": 0, "overhead": 0, "concaten": 0, "call": 0, "time": 0, "equival": 0, "argument": 0, "separ": 0, "combin": 0, "see": 0, "also": 0, "binari": 0, "mai": 0, "includ": 0, "null": 0, "To": 0, "displai": 0, "result": 0, "form": 0, "method": 0, "given": 0, "hexadecim": 0}, "objects": {"": [[0, 0, 0, "hash-algorithms:hash-algorithms:[hash]", "<hash>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[md5]", "<md5>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha1]", "<sha1>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha224]", "<sha224>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha256]", "<sha256>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha384]", "<sha384>"], [0, 0, 0, "hash-algorithms:hash-algorithms:[sha512]", "<sha512>"], [0, 1, 0, "hash-algorithms:hash-algorithms:block-size", "block-size"], [0, 1, 0, "hash-algorithms:hash-algorithms:digest", "digest"], [0, 1, 0, "hash-algorithms:hash-algorithms:digest-size", "digest-size"], [0, 2, 0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])", "hexdigest(<byte-vector>)"], [0, 2, 0, "hash-algorithms:hash-algorithms:hexdigest([hash])", "hexdigest(<hash>)"], [0, 1, 0, "hash-algorithms:hash-algorithms:md5", "md5"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha1", "sha1"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha224", "sha224"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha256", "sha256"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha384", "sha384"], [0, 1, 0, "hash-algorithms:hash-algorithms:sha512", "sha512"], [0, 1, 0, "hash-algorithms:hash-algorithms:update-hash", "update-hash"]]}, "objtypes": {"0": "dylan:class", "1": "dylan:function", "2": "dylan:method"}, "objnames": {"0": ["dylan", "class", "Dylan class"], "1": ["dylan", "function", "Dylan function"], "2": ["dylan", "method", "Dylan method"]}, "titleterms": {"hash": 0, "algorithm": 0, "The": 0, "modul": 0, "md5": 0, "sha": 0, "1": 0, "2": 0}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 58}, "alltitles": {"hash-algorithms": [[0, "hash-algorithms"]], "The hash-algorithms Module": [[0, "the-hash-algorithms-module"]], "MD5": [[0, "md5"]], "SHA-1": [[0, "sha-1"]], "SHA-2": [[0, "sha-2"]]}, "indexentries": {"": [[0, "hash-algorithms:hash-algorithms:[hash]"]], "": [[0, "hash-algorithms:hash-algorithms:[md5]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha1]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha224]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha256]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha384]"]], "": [[0, "hash-algorithms:hash-algorithms:[sha512]"]], "block-size": [[0, "hash-algorithms:hash-algorithms:block-size"]], "digest": [[0, "hash-algorithms:hash-algorithms:digest"]], "digest-size": [[0, "hash-algorithms:hash-algorithms:digest-size"]], "hexdigest": [[0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])"], [0, "hash-algorithms:hash-algorithms:hexdigest([hash])"]], "hexdigest()": [[0, "hash-algorithms:hash-algorithms:hexdigest([byte-vector])"]], "hexdigest()": [[0, "hash-algorithms:hash-algorithms:hexdigest([hash])"]], "md5": [[0, "hash-algorithms:hash-algorithms:md5"]], "sha1": [[0, "hash-algorithms:hash-algorithms:sha1"]], "sha224": [[0, "hash-algorithms:hash-algorithms:sha224"]], "sha256": [[0, "hash-algorithms:hash-algorithms:sha256"]], "sha384": [[0, "hash-algorithms:hash-algorithms:sha384"]], "sha512": [[0, "hash-algorithms:hash-algorithms:sha512"]], "update-hash": [[0, "hash-algorithms:hash-algorithms:update-hash"]]}}) \ No newline at end of file