Closed ChickenProp closed 1 year ago
Indeed, it seems the postgres implementation is not consistent: https://github.com/array-analytics/plpg_hashids/issues/13
@ChickenProp Sorry for the late response and I agree - the tests should be the same across implementations. We're fixing that as we're moving to the new algorithm.
Closing since the project is moving.
For each of the 40 implementations listed on the hashids website, has someone made sure they give the same results as each other? I'm sure several of them have been checked against others. But I wouldn't be surprised if at least one of them gives different results.
I feel like the website should have resources for implementers, and one of the resources should be a file containing a long list of unit tests. Possibly in JSON, possibly some other format that's easy to parse. Then implementers can include that file in their own test suites, and just write a (hopefully fairly simple) test runner for them. It would presumably have tests like:
[1]: If using JSON, such numbers might need to be written as strings. Otherwise the parsing step might not preserve them correctly.