Re: [R] hash code for arbitrary object

2005-08-03 Thread Roger D. Peng
You can compute MD5 and SHA1 digests with the 'digest' package.

-roger

Adrian Baddeley wrote:
 Can anyone suggest a simple way to calculate a 'hash code'
 from an arbitrary R object?
 
 hash(x) should return an integer or string 
 with the property that 
  if hash(x) != hash(y) then x and y are not identical
 and the time to compute hash(x) should be quite short.
 
 Any suggestions welcome
 thanks
 Adrian Baddeley
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] hash code for arbitrary object

2005-08-02 Thread Adrian Baddeley
Can anyone suggest a simple way to calculate a 'hash code'
from an arbitrary R object?

hash(x) should return an integer or string 
with the property that 
 if hash(x) != hash(y) then x and y are not identical
and the time to compute hash(x) should be quite short.

Any suggestions welcome
thanks
Adrian Baddeley

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] hash code for arbitrary object

2005-08-02 Thread Marc Schwartz
On Wed, 2005-08-03 at 12:05 +0800, Adrian Baddeley wrote:
 Can anyone suggest a simple way to calculate a 'hash code'
 from an arbitrary R object?
 
 hash(x) should return an integer or string 
 with the property that 
  if hash(x) != hash(y) then x and y are not identical
 and the time to compute hash(x) should be quite short.
 
 Any suggestions welcome
 thanks
 Adrian Baddeley


Take a look at Dirk Eddelbuettel's digest() function in the package of
the same name on CRAN. Be sure to read the details section for caveats
regarding collisions.

HTH,

Marc Schwartz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html