You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is generally accepted that fingerprint and hashing functions should be written in fully compiled languages, as they are highly inefficient otherwise.
I request a new Asymptote builtin function to take a fingerprint/hash of a string, for two purposes:
To construct filenames dynamically based on the contents of the file (so that two files with different contents will be all but guaranteed different filenames). This is useful when creating files dynamically to be subsequently imported.
To create hashtable classes with strings as keys.
An important detail for the first usage is that it should be possible to use this builtin function to create long enough hashes to all but guarantee uniqueness (since having a filename collision would likely cause an error rather than just a slightly longer running time). I recommend https://github.com/google/highwayhash as a library that can provide fast, high-quality hashes in C/C++ up to 256 bits.
For the exact signature of the builtin, I recommend returning an array of ints (each having 32 bits of information, since Asymptote has no uint64 type). Potentially, the length of the returned array could depend on a user-provided parameter, so that extra effort is not used to compute unneeded bits.
The text was updated successfully, but these errors were encountered:
It is generally accepted that fingerprint and hashing functions should be written in fully compiled languages, as they are highly inefficient otherwise.
I request a new Asymptote builtin function to take a fingerprint/hash of a string, for two purposes:
An important detail for the first usage is that it should be possible to use this builtin function to create long enough hashes to all but guarantee uniqueness (since having a filename collision would likely cause an error rather than just a slightly longer running time). I recommend https://github.com/google/highwayhash as a library that can provide fast, high-quality hashes in C/C++ up to 256 bits.
For the exact signature of the builtin, I recommend returning an array of ints (each having 32 bits of information, since Asymptote has no uint64 type). Potentially, the length of the returned array could depend on a user-provided parameter, so that extra effort is not used to compute unneeded bits.
The text was updated successfully, but these errors were encountered: