<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.erights.org/mediawiki/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>HashAlgorithm - Revision history</title>
		<link>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Thu, 11 Jun 2026 05:25:34 GMT</lastBuildDate>
		<item>
			<title>Kevin Reid:&amp;#32;formatting</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=1968&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=1968&amp;oldid=prev</guid>
			<description>&lt;p&gt;formatting&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Part of a [[Hash upgradability]] design issue proposal.&lt;br /&gt;
&lt;br /&gt;
Please comment, especially on whether this seems overly baroque. --[[User:Kevin Reid|Kevin Reid]] 19:03, 29 August 2009 (CDT)&lt;br /&gt;
&lt;br /&gt;
==HashAlgorithm object protocol==&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|run|0||[[Tuple]]&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[OutStream]]&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;0..255], [[vow]]&amp;lt;nowiki&amp;gt;[&amp;lt;/nowiki&amp;gt;[[#Hash|Hash]]]&amp;lt;nowiki&amp;gt;]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Prepares for a hash computation. Write the data to be hashed to the returned [[OutStream]]; when it is closed the returned promise will (synchronously) resolve to the hash value.&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|hashSize|0||[[Integer]]}}&lt;br /&gt;
&lt;br /&gt;
Returns the number of bits in the hashes produced.&lt;br /&gt;
&lt;br /&gt;
===Properties===&lt;br /&gt;
&lt;br /&gt;
A HashAlgorithm should be [[DeepFrozen]] and [[PassByCopy]].&lt;br /&gt;
&lt;br /&gt;
It should be the case that&lt;br /&gt;
 def [stream, hash] := someHashAlgorithm()&lt;br /&gt;
 ...do anything with &amp;lt;var&amp;gt;stream&amp;lt;/var&amp;gt;...&lt;br /&gt;
 !Ref.isNear(hash) || hash.hashAlgorithm() == someHashAlgorithm&lt;br /&gt;
{{XXX|Note that the above property can be enforced by a wrapper. Change protocol so that there isn't such a property to violate, by having a canonical hash-maker?}} i.e. hash(hashAlgorithm) =&amp;gt; [OutStream,vow[Hash]] and the hashAlgorithm just returns the bits. Or is this too much complexity for the client by having to import 'hash' as well as the algorithm?&lt;br /&gt;
&lt;br /&gt;
===Extensions===&lt;br /&gt;
&lt;br /&gt;
To discuss: add convenience method to hash a given List[0..255]? A given integer?&lt;br /&gt;
&lt;br /&gt;
==Hash objects==&lt;br /&gt;
&lt;br /&gt;
For flexibility, discoverability, and type checking benefits, hash algorithms return Hash objects which contain the bits of the hash value. All hash algorithms use the same implementation of Hash objects, but Hash objects are tagged with the algorithm that produced them.&lt;br /&gt;
&lt;br /&gt;
Hash objects are [[Selfless]] and [[Transparent]]. Their portrayal is &amp;lt;code&amp;gt;[makeHash, &amp;quot;run&amp;quot;, [&amp;lt;var&amp;gt;hashAlgorithm&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;hashBits&amp;lt;/var&amp;gt; :[[List]][0..255]]]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that by including the hash algorithm in the portrayal:&lt;br /&gt;
* A vat unserializing a Hash either must have that hash algorithm implementation, or the algorithm must unserialize as a dummy HashAlgorithm which has a name but no actual implementation. (The latter means that at least the vat can represent and pass around the hash objects.)&lt;br /&gt;
* Given a hash, you can hash other data using the same algorithm without previously knowing of that algorithm. {{XXX|Crypto people please comment: Is this actually useful?}}&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|octets|0||[[List]][0..255]}}&lt;br /&gt;
&lt;br /&gt;
Returns the hash value as a list of octets. This should be used as the canonical raw-bits representation of this hash.&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|integer|0||[[Integer]]}}&lt;br /&gt;
&lt;br /&gt;
Returns the hash value interpreted as a big-endian unsigned integer. Note that if the hash value happens to begin with at least 8 zero bits, then the conversion is not reversible: interpreting the integer as a list of octets will lose that leading zero octet(s).&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|hashAlgorithm|0||[[HashAlgorithm]]}}&lt;br /&gt;
&lt;br /&gt;
Return the hash algorithm which produced this hash.&lt;br /&gt;
&lt;br /&gt;
{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX|write spec on op__cmp and how this should be described}}&lt;br /&gt;
&lt;br /&gt;
The standard comparison protocol. If the hash algorithm is the same, returns a lexicographic comparison of the bits, else incomparable (NaN).&lt;/div&gt;</description>
			<pubDate>Sat, 10 Apr 2010 18:37:44 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/Talk:HashAlgorithm</comments>		</item>
		<item>
			<title>Kevin Reid:&amp;#32;various revision: add Hash#hashAlgorithm/0, talk about Selfless and DeepFrozen, non-reversibility of integer/0, etc.</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4226&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4226&amp;oldid=prev</guid>
			<description>&lt;p&gt;various revision: add Hash#hashAlgorithm/0, talk about Selfless and DeepFrozen, non-reversibility of integer/0, etc.&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 18:36, 10 April 2010&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the number of bits in the hashes produced.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the number of bits in the hashes produced.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;===Properties===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;A HashAlgorithm should be [[DeepFrozen]] and [[PassByCopy]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;It should be the case that&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; def [stream, hash] := someHashAlgorithm()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; ...do anything with &amp;lt;var&amp;gt;stream&amp;lt;/var&amp;gt;...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; !Ref.isNear(hash) || hash.hashAlgorithm() == someHashAlgorithm&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{XXX|Note that the above property can be enforced by a wrapper. Change protocol so that there isn't such a property to violate, by having a canonical hash-maker? i.e. hash(hashAlgorithm) =&amp;gt; [OutStream,vow[Hash]] and the hashAlgorithm just returns the bits. Or is this too much complexity for the client by having to import 'hash' as well as the algorithm?}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Extensions===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Extensions===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To discuss: add convenience method to hash a given List[0..255]? A given integer?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To discuss: add convenience method to hash a given List[0..255]? A given integer?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Hash==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;objects&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For flexibility, discoverability, and type checking benefits, hash algorithms return Hash objects which contain the bits of the hash value. All hash algorithms &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;produce &lt;/del&gt;the same Hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;object&lt;/del&gt;, but Hash objects are tagged with the algorithm that produced them.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For flexibility, discoverability, and type checking benefits, hash algorithms return Hash objects which contain the bits of the hash value. All hash algorithms &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;use &lt;/ins&gt;the same &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;implementation of &lt;/ins&gt;Hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;objects&lt;/ins&gt;, but Hash objects are tagged with the algorithm that produced them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Hash objects are Selfless. Their portrayal is &amp;lt;code&amp;gt;[makeHash, &amp;quot;run&amp;quot;, [&amp;lt;var&amp;gt;hashAlgorithm&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;hashBits&amp;lt;/var&amp;gt; :[[List]][0..255]]]&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Hash objects are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;Selfless&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] and [[Transparent]]&lt;/ins&gt;. Their portrayal is &amp;lt;code&amp;gt;[makeHash, &amp;quot;run&amp;quot;, [&amp;lt;var&amp;gt;hashAlgorithm&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;hashBits&amp;lt;/var&amp;gt; :[[List]][0..255]]]&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|What exactly is &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;hashAlgorithm value of &lt;/del&gt;a Hash&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;? The &lt;/del&gt;algorithm &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;object? A string? Must take into consideration letting them &lt;/del&gt;unserialize &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;on vats &lt;/del&gt;that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;don't have &lt;/del&gt;the hash algorithm &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;itself&lt;/del&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Note that by including &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;hash algorithm in the portrayal:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; * A vat unserializing &lt;/ins&gt;a Hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;either must have that hash &lt;/ins&gt;algorithm &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;implementation, or the algorithm must &lt;/ins&gt;unserialize &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as a dummy HashAlgorithm which has a name but no actual implementation. (The latter means &lt;/ins&gt;that &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;at least the vat can represent and pass around &lt;/ins&gt;the hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;objects.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;nbsp; * Given a hash, you can hash other data using the same algorithm without previously knowing of that &lt;/ins&gt;algorithm. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|Crypto people please comment: Is this actually useful?&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{instance msgdoc|octets|0||[[List]][0..255]}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Returns the hash value as a list of octets. This should be used as the canonical raw-bits representation of this hash.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|integer|0||[[Integer]]}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|integer|0||[[Integer]]}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value interpreted as a big-endian unsigned integer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value interpreted as a big-endian unsigned integer&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Note that if the hash value happens to begin with at least 8 zero bits, then the conversion is not reversible: interpreting the integer as a list of octets will lose that leading zero octet(s)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;octets&lt;/del&gt;|0||[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;List&lt;/del&gt;]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;][0..255&lt;/del&gt;]}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;hashAlgorithm&lt;/ins&gt;|0||[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;HashAlgorithm&lt;/ins&gt;]]}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Returns &lt;/del&gt;the hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;value as a list of octets&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Return &lt;/ins&gt;the hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;algorithm which produced this hash&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX|write spec on op__cmp and how this should be described}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX|write spec on op__cmp and how this should be described}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The comparison protocol. If the hash algorithm is the same, a lexicographic comparison of the bits, else incomparable (NaN).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;standard &lt;/ins&gt;comparison protocol. If the hash algorithm is the same, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;returns &lt;/ins&gt;a lexicographic comparison of the bits, else incomparable (NaN).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|add method to expose hashAlgorithm}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-06-11 05:25:35 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 10 Apr 2010 18:36:27 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/Talk:HashAlgorithm</comments>		</item>
		<item>
			<title>Kevin Reid:&amp;#32;fix XXX template</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4225&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4225&amp;oldid=prev</guid>
			<description>&lt;p&gt;fix XXX template&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:01, 10 April 2010&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value as a list of octets.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value as a list of octets.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX write spec on op__cmp and how this should be described}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/ins&gt;write spec on op__cmp and how this should be described}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The comparison protocol. If the hash algorithm is the same, a lexicographic comparison of the bits, else incomparable (NaN).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The comparison protocol. If the hash algorithm is the same, a lexicographic comparison of the bits, else incomparable (NaN).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{XXX|add method to expose hashAlgorithm}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{XXX|add method to expose hashAlgorithm}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-06-11 05:25:36 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 10 Apr 2010 17:01:16 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/Talk:HashAlgorithm</comments>		</item>
		<item>
			<title>Kevin Reid:&amp;#32;idea related to Hash upgradability</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4224&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=HashAlgorithm&amp;diff=4224&amp;oldid=prev</guid>
			<description>&lt;p&gt;idea related to &lt;a href=&quot;/wiki/Hash_upgradability&quot; title=&quot;Hash upgradability&quot;&gt;Hash upgradability&lt;/a&gt;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:03, 30 August 2009&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the number of bits in the hashes produced.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the number of bits in the hashes produced.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;===Properties===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;A HashAlgorithm should be [[DeepFrozen]] and [[PassByCopy]].&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;It should be the case that&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; def [stream, hash] := someHashAlgorithm()&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; ...do anything with &amp;lt;var&amp;gt;stream&amp;lt;/var&amp;gt;...&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; !Ref.isNear(hash) || hash.hashAlgorithm() == someHashAlgorithm&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;{{XXX|Note that the above property can be enforced by a wrapper. Change protocol so that there isn't such a property to violate, by having a canonical hash-maker?}} i.e. hash(hashAlgorithm) =&amp;gt; [OutStream,vow[Hash]] and the hashAlgorithm just returns the bits. Or is this too much complexity for the client by having to import 'hash' as well as the algorithm?&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Extensions===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;===Extensions===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 27:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To discuss: add convenience method to hash a given List[0..255]? A given integer?&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To discuss: add convenience method to hash a given List[0..255]? A given integer?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;objects&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Hash==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For flexibility, discoverability, and type checking benefits, hash algorithms return Hash objects which contain the bits of the hash value. All hash algorithms &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;use &lt;/del&gt;the same &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;implementation of &lt;/del&gt;Hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;objects&lt;/del&gt;, but Hash objects are tagged with the algorithm that produced them.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;For flexibility, discoverability, and type checking benefits, hash algorithms return Hash objects which contain the bits of the hash value. All hash algorithms &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;produce &lt;/ins&gt;the same Hash &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;object&lt;/ins&gt;, but Hash objects are tagged with the algorithm that produced them.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Hash objects are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/del&gt;Selfless&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]] and [[Transparent]]&lt;/del&gt;. Their portrayal is &amp;lt;code&amp;gt;[makeHash, &amp;quot;run&amp;quot;, [&amp;lt;var&amp;gt;hashAlgorithm&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;hashBits&amp;lt;/var&amp;gt; :[[List]][0..255]]]&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Hash objects are Selfless. Their portrayal is &amp;lt;code&amp;gt;[makeHash, &amp;quot;run&amp;quot;, [&amp;lt;var&amp;gt;hashAlgorithm&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;hashBits&amp;lt;/var&amp;gt; :[[List]][0..255]]]&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Note that by including &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;hash algorithm in the portrayal:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|What exactly is &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;hashAlgorithm value of &lt;/ins&gt;a Hash&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;? The &lt;/ins&gt;algorithm &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;object? A string? Must take into consideration letting them &lt;/ins&gt;unserialize &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;on vats &lt;/ins&gt;that &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;don't have &lt;/ins&gt;the hash algorithm &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;itself&lt;/ins&gt;.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* A vat unserializing &lt;/del&gt;a Hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;either must have that hash &lt;/del&gt;algorithm &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;implementation, or the algorithm must &lt;/del&gt;unserialize &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;as a dummy HashAlgorithm which has a name but no actual implementation. (The latter means &lt;/del&gt;that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;at least the vat can represent and pass around &lt;/del&gt;the hash &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;objects.)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;* Given a hash, you can hash other data using the same algorithm without previously knowing of that &lt;/del&gt;algorithm. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|Crypto people please comment: Is this actually useful?&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;octets&lt;/del&gt;|0||[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;List&lt;/del&gt;]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;][0..255&lt;/del&gt;]}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;integer&lt;/ins&gt;|0||[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Integer&lt;/ins&gt;]]}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value as a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;list of octets. This should be used as the canonical raw&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bits representation of this hash&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Returns the hash value &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;interpreted &lt;/ins&gt;as a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;big&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;endian unsigned integer&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;integer&lt;/del&gt;|0||[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Integer&lt;/del&gt;]]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{instance msgdoc|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;octets&lt;/ins&gt;|0||[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;List&lt;/ins&gt;]]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[0&lt;/ins&gt;..&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;255]}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Returns the hash value interpreted as a big-endian unsigned integer&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Note that if the hash value happens to begin with at least 8 zero bits, then the conversion is not reversible: interpreting the integer as a list of octets will lose that leading zero octet(s)&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{instance msgdoc|hashAlgorithm|0||[[HashAlgorithm]]}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Returns the hash value as a list of octets.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Return the hash algorithm which produced &lt;/del&gt;this &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;hash.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{instance msgdoc|op__cmp|1|other :any[Hash, any]|comparison result}} {{XXX write spec on op__cmp and how &lt;/ins&gt;this &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;should be described}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;{{instance msgdoc|op__cmp|1|other :any[Hash&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;any]|&lt;/del&gt;comparison &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;result}} {{XXX|write spec on op__cmp and how this should be described}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The comparison protocol. If the hash algorithm is the same&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;a lexicographic &lt;/ins&gt;comparison &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;of the bits, else incomparable (NaN).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The standard comparison protocol. If the hash algorithm is the same, returns a lexicographic comparison of the bits, else incomparable (NaN).&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;{{XXX|add method to expose hashAlgorithm}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-06-11 05:25:36 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sun, 30 Aug 2009 00:03:52 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/Talk:HashAlgorithm</comments>		</item>
	</channel>
</rss>