diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-07-05 19:58:18 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-07-05 19:58:18 -0700 |
commit | 6e7c0080cdb160d18c0a83f5f85e92a9b988bb5f (patch) | |
tree | 10c2a569393b82bb403da79e9ad16c8ce7f7feb7 /lib.h | |
parent | 44b66777caafeebf543c32c9373632c04f748353 (diff) | |
download | txr-6e7c0080cdb160d18c0a83f5f85e92a9b988bb5f.tar.gz txr-6e7c0080cdb160d18c0a83f5f85e92a9b988bb5f.tar.bz2 txr-6e7c0080cdb160d18c0a83f5f85e92a9b988bb5f.zip |
hashing: overhaul part 2.
In this commit we feature-complete the seeded hashing
implementation. The *hash-seed* special variable is provided
from which newly created hashes take their seed. The
make-hash and hash-equal functions get an optional seed
argument. A function called gen-hash-seed is provided for
obtaining a randomized seed.
* hash.c (hash_seed): New macro.
(hash_seed_s): New symbol variable.
(make_seeded_hash): New function, made from make_hash.
(make_hash): Reduced to wrapper around make_seeded_hash.
(hash-equal): Take seed argument.
(gen_hash_seed): New function.
(hash_init): Initialize hash_seed_s and register *hash-seed*
special variable. Re-register make-hash with new optional
parameter, with regard to make_seeded_hash.
Re-register hash-equal with new optional parameter.
Register gen-hash-seed.
* hash.h (make_seeded_hash): Declared.
(hash_equal): Declaration updated.
* txr.1: Documented optional seed arguments of make-hash
and hash-equal. Documented new *hash-seed* variable
and gen-hash-seed function.
Diffstat (limited to 'lib.h')
0 files changed, 0 insertions, 0 deletions