vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

Add a hash function #406

Closed charlesstaats closed 5 months ago

charlesstaats commented 6 months ago

Add a hash function for strings. This hash function is based on std::hash, but with two notes:

The result is a new builtin function <int hash(string s, bool try_consistent=<default>)>.

user202729 commented 6 months ago

If we have taken the effort to write such a thing, why not make it cryptographically secure? (might need an extra dependency on OpenSSL though for maybe SHA256?)

charlesstaats commented 5 months ago

I ended up adding a bunch more commits to this branch, so this pull request no longer really makes sense.