Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XXHash for PHP (without module/extension)

For on online service, I'm currently using XXHash. Now I'm trying to create a plugin for webshops but these shops are all using PHP, mostly on shared hosting platforms. Problem with this is that the available XXHash plugins all require to have XXHash extension installed. Which is something hard to request on shared hosting platforms. Now I'm wondering if I should move away from XXHash to something that has a module less support for hashing or if there is a possibility to have XXHash working on PHP without the use of an extension. A webservice was one of the ideas but XXHash is used specifically for privacy reasons in our case so this webservice would be a bad solution.

Any ideas?

like image 968
spa900 Avatar asked Dec 08 '25 16:12

spa900


1 Answers

Only alternative seems to be using different language for the hashing function. Maybe compiling the C code used here: https://github.com/mscdex/node-xxhash/blob/master/src/hash_64.hpp and using this together with exec. (For as long as this command isn't blacklisted)

like image 131
spa900 Avatar answered Dec 11 '25 10:12

spa900