Skip to content

Commit

Permalink
Merge pull request #1206 from ChristianGruen/1195
Browse files Browse the repository at this point in the history
1195 Hash Function: CRC-32
  • Loading branch information
ndw authored May 14, 2024
2 parents 1aec9ab + 870d843 commit 0ed65bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
17 changes: 13 additions & 4 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5119,7 +5119,6 @@ return normalize-unicode(concat($v1, $v2))</eg>
<fos:proto name="hash" return-type="xs:hexBinary?">
<fos:arg name="value" type="(xs:string | xs:hexBinary | xs:base64Binary)?"/>
<fos:arg name="options" type="map(*)?" default="{}"/>
<!--<fos:arg name="algorithm" type="xs:string?" default="'MD5'"/>-->
</fos:proto>
</fos:signatures>
<fos:properties arity="1">
Expand Down Expand Up @@ -5170,6 +5169,8 @@ return normalize-unicode(concat($v1, $v2))</eg>
ref="fips180-4"/>. </p></item>
<item><p><code>SHA-256</code>: the <code>SHA-256</code> algorithm, defined by <bibref
ref="fips180-4"/>. </p></item>
<item><p><code>CRC-32</code>: the <code>CRC-32</code> algorithm, defined by <bibref
ref="ieee802-3"/>. </p></item>
</ulist>
<p>Conforming implementations <rfc2119>may</rfc2119> support other checksum and
hash functions with implementation-defined semantics.</p>
Expand Down Expand Up @@ -5241,10 +5242,18 @@ return normalize-unicode(concat($v1, $v2))</eg>
=> string()</eg></fos:expression>
<fos:result>"9C9B913EB1B6254F4737CE947EFD16F16E916F9D6EE5C1102A2002E48D4C88BD"</fos:result>
</fos:test>
<!--<fos:test>
<fos:test>
<fos:expression><eg>hash("", { "algorithm": "CRC-32" }) => string()</eg></fos:expression>
<fos:result>"00000000"</fos:result>
</fos:test>
<fos:test>
<fos:expression><eg>hash("input", { "algorithm": "CRC-32" }) => string()</eg></fos:expression>
<fos:result>"D82832D7"</fos:result>
</fos:test>
<fos:test use="v-hash-salt">
<fos:expression>hash("password123" || $salt, "sha-1234567")</fos:expression>
<fos:error-result error-code="TODO: error code"/>
</fos:test>-->
<fos:error-result error-code="FOHA0001"/>
</fos:test>
</fos:example>
</fos:examples>
<fos:history>
Expand Down
3 changes: 3 additions & 0 deletions specifications/xpath-functions-40/src/xpath-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10858,6 +10858,9 @@ purposes of this rule that casting to <code>xs:NOTATION</code> succeeds.
Floating-Point Arithmetic.</emph>
</bibl>

<bibl id="ieee802-3" key="IEEE 802-3">IEEE. <emph>IEEE Ethernet Standard.</emph>
</bibl>

<bibl id="ISO3166" key="ISO 3166-1">ISO (International Organization for Standardization)
<emph>Codes for the representation of names of countries
and their subdivisions - Part 1: Country codes</emph> ISO 3166-1:2013.
Expand Down

0 comments on commit 0ed65bc

Please sign in to comment.