core: add Byte.hash

This commit is contained in:
hellerve 2019-10-25 15:12:36 +02:00
parent 15c27bdb49
commit 98bc275ea5
2 changed files with 23 additions and 0 deletions

View File

@ -29,6 +29,10 @@
(defn hash [k] (to-int (the Char @k)))
)
(defmodule Byte
(defn hash [k] (to-int (the Byte @k)))
)
(defmodule Float
(defn hash [k] (to-bytes @k))
)

View File

@ -545,6 +545,25 @@
</p>
</div>
<div class="binder">
<a class="anchor" href="#hash">
<h3 id="hash">
hash
</h3>
</a>
<div class="description">
defn
</div>
<p class="sig">
(λ [&amp;Byte] Int)
</p>
<pre class="args">
(hash k)
</pre>
<p class="doc">
</p>
</div>
<div class="binder">
<a class="anchor" href="#inc">
<h3 id="inc">