Open-EO / openeo-js-client

JavaScript and TypeScript client for the openEO API.
https://open-eo.github.io/openeo-js-client/latest/
Apache License 2.0
15 stars 6 forks source link

Use object-hash library instead of JSON.stringify #6

Closed christophfriedrich closed 5 years ago

christophfriedrich commented 5 years ago

To turn the parameter objects into strings (for usage as keys in a Map), the Earth Engine driver uses the object-hash library. In this client, I used JSON.stringify instead because it was at hand and I don't like additional libraries if I don't really need them.

Since @m-mohr had a reason for choosing the lib over the built-in (I remember something like "JSON.stringify is not deterministic"?) it may be smart to use that lib here, too.

m-mohr commented 5 years ago

When working on this, we should have a look at #7 as it's not just replacing JSON.stringify() by object-hash. I added some comments there.

m-mohr commented 5 years ago

I tried to come up with a more light-weight approach than the hash-library based on https://en.wikipedia.org/wiki/Jenkins_hash_function - will probably be not 100% safe to collisions, but should be suitable for our use-case.