| string-hash(3scm) | Scheme Programmer's Manual | string-hash(3scm) |
NAME
string-hash, string-ci-hash - string hash functions
LIBRARY
(import (rnrs)) ;R6RS (import (rnrs hashtables)) ;R6RS
SYNOPSIS
(string-hash string) (string-ci-hash string)
DESCRIPTION
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.
RETURN VALUES
Returns a single value; an integer.
EXAMPLES
(= (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
APPLICATION USAGE
This procedure is used as an argument to make-hashtable(3scm).
ERRORS
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.
SEE ALSO
make-hashtable(3scm)
STANDARDS
R6RS, SRFI-69
HISTORY
The first Scheme report to include this procedure was R6RS for its new hashtable library. There is a similar procedure in SRFI-69.
AUTHORS
This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.
| 2022-05-12 |