Next: syslib tcbuckets, Previous: syslib pointers, Up: syslib [Index]

The following bindings are exported by the library ```
(vicare
system $hashtables)
```

.

- Unsafe Operation:
**$string-hash**`string` - Unsafe Operation:
**$string-hash**`string``max-len` Return an integer hash value for

`string`, based on its current contents. This hash function is suitable for use with`string=?`

as an equivalence function.About the

`max-len`argument:- When
`max-len`is a non–negative fixnum: it is the maximum number of characters to use to compute the hash value, starting from the beginning of`string`. If the length of`string`is greater than`max-len`: only the first`max-len`characters are used. If the length of`string`is less than or equal to`max-len`: all the bytes in`string`are used. - When
`max-len`is`#f`

or not used: if the length of`string`is greater than*64*characters, only the first*64*bytes are used to compute the hash. - When
`max-len`is`#t`

: all the bytes in`string`are used.

**NOTE**When the hash value is computed using a number of characters*N*less than the string length: applications**must not**assume that two strings having the first*N*characters equal will have the same hash value.- When

- Unsafe Operation:
**$string-ci-hash**`string` - Unsafe Operation:
**$string-ci-hash**`string``max-len` Return an integer hash value for

`string`based on its current contents, ignoring case. This hash function is suitable for use with`string-ci=?`

as an equivalence function.The optional argument

`max-len`is used as in`$string-hash`

.

- Unsafe Operation:
**$symbol-hash**`symbol` Return an integer hash value for

`symbol`.

- Unsafe Operation:
**$bytevector-hash**`bytevector` - Unsafe Operation:
**$bytevector-hash**`bytevector``max-len` Return an integer hash value for

`bytevector`, based on its current contents. This hash function is suitable for use with`bytevector=?`

as an equivalence function.About the

`max-len`argument:- When
`max-len`is a non–negative fixnum: it is the maximum number of bytes to use to compute the hash value, starting from the beginning of`bv`. If the length of`bv`is greater than`max-len`: only the first`max-len`bytes are used. If the length of`bv`is less than or equal to`max-len`: all the bytes in`bv`are used. - When
`max-len`is`#f`

or not present: if the length of`bv`is greater than*256*bytes, only the first*256*bytes are used to compute the hash. - When
`max-len`is`#t`

: all the bytes in`bv`are used.

**NOTE**When the hash value is computed using a number of bytes*N*less than the bytevector length: applications**must not**assume that two bytevectors having the first*N*bytes equal will have the same hash value.- When

- Unsafe Operation:
**$vector-hash**`vec` - Unsafe Operation:
**$vector-hash**`vec``max-len` Return a non–negative fixnum representing the hash value for

`vec`, based on its current contents. When creating hash tables using vectors as keys: this hash function is suitable for use with`vector=?`

as an equivalence function.About the

`max-len`argument:- When
`max-len`is a non–negative fixnum: it is the maximum number of items to use to compute the hash value, starting from the beginning of`vec`. If the length of`vec`is greater than`max-len`: only the first`max-len`items are used. If the length of`vec`is less than or equal to`max-len`: all the items in`vec`are used. - When
`max-len`is`#f`

or not present: if the length of`vec`is greater than*3*items, only the first*3*items are used to compute the hash. - When
`max-len`is`#t`

: all the items in`vec`are used.

**NOTE**When the hash value is computed using a number of items*N*less than the vector length: applications**must not**assume that two vectors having the first*N*items equal will have the same hash value.- When

- Unsafe Operation:
**$list-hash**`ell` - Unsafe Operation:
**$list-hash**`ell``max-len` Return a non–negative fixnum representing the hash value for

`ell`, based on its current contents. When creating hash tables using lists as keys: this hash function is suitable for use with`list=?`

as an equivalence function.About the

`max-len`argument:- When
`max-len`is a non–negative fixnum: it is the maximum number of items to use to compute the hash value, starting from the beginning of`ell`. If the length of`ell`is greater than`max-len`: only the first`max-len`items are used. If the length of`ell`is less than or equal to`max-len`: all the items in`ell`are used. - When
`max-len`is`#f`

or not present: if the length of`ell`is greater than*3*items, only the first*3*items are used to compute the hash. - When
`max-len`is`#t`

: all the items in`ell`are used.

**NOTE**When the hash value is computed using a number of items*N*less than the list length: applications**must not**assume that two lists having the first*N*items equal will have the same hash value.- When

- Unsafe Operation:
**$pair-hash**`pair` - Unsafe Operation:
**$ipair-hash**`ipair` Hash function for pairs and immutable pairs.

- Unsafe Operation:
**$char-hash**`ch` - Unsafe Operation:
**$char-ci-hash**`ch` Compute and return the hash value.

- Unsafe Operation:
**$fixnum-hash**`fx` Compute and return the hash value.

- Unsafe Operation:
**$bignum-hash**`bn` Compute and return the hash value.

- Unsafe Operation:
**$exact-integer-hash**`ei` Compute and return the hash value.

- Unsafe Operation:
**$ratnum-hash**`rn` Compute and return the hash value.

- Unsafe Operation:
**$flonum-hash**`fl` Compute and return the hash value.

- Unsafe Operation:
**$cflonum-hash**`cfl` Compute and return the hash value.

- Unsafe Operation:
**$compnum-hash**`cn` Compute and return the hash value.

- Unsafe Operation:
**$transcoder-hash**`tran` Compute and return the hash value.

- Unsafe Operation:
**$enum-set-hash**`es` Hash function for enumeration sets.

- Unsafe Operation:
**$pointer-hash**`ptr` Return a fixnum representing the hash value of

`ptr`.

- Unsafe Operation:
**$promise-hash**`prom` Hash function for promise objects.

- Unsafe Operation:
**$record-hash**`reco` - Unsafe Operation:
**$struct-hash**`stru` Compute and return the hash value.

**NOTE**The result returned by these hash functions depends on the values in the fields, so: it will change if the fields are mutated.

- Unsafe Operation:
**$hashtable-type-descriptor**`table` - Unsafe Operation:
**$hashtable-type-descriptor-set!**`table``des` Setter and getter for the hashtable run–time type descriptor.

`des`must be an instance of`<hashtable-type-descr>`

.

Next: syslib tcbuckets, Previous: syslib pointers, Up: syslib [Index]