string-hash, string-ci-hash - string hash functions
(import (rnrs)) ;R6RS
(import (rnrs hashtables)) ;R6RS
(string-hash string)
(string-ci-hash string)
Returns an integer hash value for string, based on its current contents.
It is used with make-hashtable(3scm).
- string-hash
- This hash function is suitable for use with string=?(3scm) as an
equivalence function.
- string-ci-hash
- This hash function ignores case. It is suitable for use with
string-ci=?(3scm) as an equivalence function.
Returns a single value; an integer.
(= (string-hash "Quux") (string-hash "Quux")) => #t
(= (string-ci-hash "quux") (string-hash "QUUX")) => #t or #f
(= (string-hash "foo") (string-hash "bar")) => #t or #f
This procedure is used as an argument to make-hashtable(3scm).
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
- The wrong number of arguments was passed or an argument was outside its
domain.
The first Scheme report to include this procedure was R6RS for its new hashtable
library. There is a similar procedure in SRFI-69.