GOLF(2gg)
π GOLF(2gg) β get-hash π
okay bestie, welcome to the GOLF(2gg) manual, section Development, and today's main character is get-hash π«Ά
β¨ NAME β¨
get-hash β (hash)
π― PURPOSE π―
Get usage specifics for a hash. that's it, that's the whole vibe π
π SYNTAX π
get-hash <hash > \
( length <length> ) \
| ( hash-size <hash size> ) \
| ( average-reads <reads> )
πΈ DESCRIPTION πΈ
so get-hash gives you the usage specifics of a <hash> β and like, a hash that was created by new-hash, obviously. iykyk π
Use the length clause to obtain its <length>, which is literally the number of elements stored in it. then there's the hash-size clause, which gets you its <hash size> β that's the number of "buckets", aka the possible hash codes in the underlying hash table. buckets!! πͺ£β¨
The average-reads clause will obtain, in <reads>, the average number of reads β meaning how many string comparisons are needed on average to find a key β multiplied by 100. so if the average number of reads was 1.5, it will be 150. no cap, it just does that π
This info is lowkey useful for determining the performance of a hash, and for figuring out whether resize-hash is indicated. like, vibe check your hash before you start resizing things π
π¦ EXAMPLES π¦
get-hash h length l hash-size s average-reads r
π SEE ALSO π
Hash
get-hash new-hash purge-hash read-hash resize-hash write-hash
See all documentation
k byeee bestie π this iconic little page is from $VERSION, dated $DATE, and it lives in GOLF(2gg) β periodt π πβ
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms