Create hash table.
new-hash [ define ] <hash> size <size>
new-hash initializes hash table named <hash>, which is a pointer to type "vely_hash" and can be created with optional "define". <size> is the number of "buckets" in the hash table. All items with the same hash code are stored in a linked list within the same bucket. Greater table size usually means less items per bucket and better performance. However, memory usage grows with a bigger hash table, so its size should be balanced based on the program needs.
Vely uses high-performing FNV1_a
hash algorithm. Each element in a bucket list is lightweight, containing pointers to a key, value and next element in the linked list.
Note that a hash table is accessible to the current process only. <size> must be at least 10; if less, it will be set to 10.
Create a new hash with 500 buckets:
new-hash define h size 500
for more examples.
Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Icons copyright Paweł Kuna licensed under MIT
. This web page is licensed under CC-BY-SA-4.0