EVOLUTION-MANAGER
Edit File: digest2int.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: hash arbitrary string to integer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for digest2int {digest}"><tr><td>digest2int {digest}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>hash arbitrary string to integer</h2> <h3>Description</h3> <p>The <code>digest2int</code> function calculates integer hash of an arbitrary string. This is useful for randomized experiments, feature hashing, etc. </p> <h3>Usage</h3> <pre> digest2int(x, seed = 0L) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An arbitrary character vector.</p> </td></tr> <tr valign="top"><td><code>seed</code></td> <td> <p>an integer for algorithm initial state. Function will produce different hashes for same input and different seed values.</p> </td></tr> </table> <h3>Value</h3> <p>The <code>digest2int</code> function returns integer vector of the same length as input vector <code>x</code>. </p> <h3>Author(s)</h3> <p>Dmitriy Selivanov <a href="mailto:selivanov.dmitriy@gmail.com">selivanov.dmitriy@gmail.com</a> for the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> interface; Bob Jenkins for original implementation <a href="http://www.burtleburtle.net/bob/hash/doobs.html">http://www.burtleburtle.net/bob/hash/doobs.html</a> </p> <h3>References</h3> <p>Jenkins's <code>one_at_a_time</code> hash: <a href="https://en.wikipedia.org/wiki/Jenkins_hash_function#one_at_a_time">https://en.wikipedia.org/wiki/Jenkins_hash_function#one_at_a_time</a>. </p> <h3>See Also</h3> <p><code><a href="digest.html">digest</a></code></p> <h3>Examples</h3> <pre> current <- digest2int("The quick brown fox jumps over the lazy dog", 0L) target <- 1369346549L stopifnot(identical(target, current)) </pre> <hr /><div style="text-align: center;">[Package <em>digest</em> version 0.6.25 <a href="00Index.html">Index</a>]</div> </body></html>