librespot-org / librespot

Open Source Spotify client library
MIT License
4.79k stars 598 forks source link

Cargo replace hex with faster-hex #1227

Closed dsheets closed 10 months ago

dsheets commented 10 months ago

Hi, long time listener, first time caller...

I'm doing some work on the spotify_id module for another project including replacing the bespoke hex encode/decode there with a library call and I started using hex because it is a dependency of both librespot and librespot-core already... but hex doesn't appear to be maintained and it lacks really obvious stuff like symmetry between its traits and its functions and major performance issues (that we admittedly don't really care about here, yet).

Anyway, looking around crates.io, I came across faster-hex which is still far from perfect but the maintainers seem active and likely responsive. So I patched librespot and librespot-core to use it instead.

Unfortunately, I couldn't work out how to test the hashcash challenge. I tried changing my OS but that either crashes (for "android") or fails with 400 (for "ios"). I included the improved logging I added to try to understand these issues.

If you could review the changes and let me know how to test the hashcash challenge (or test it yourself or confirm that LGTY), I would be grateful. I will be sending along my spotify_id refactoring changeset soon.

Thanks!

dsheets commented 10 months ago

sigh haste makes waste, I guess. Looking at the activity on faster-hex, it doesn't look well-maintained either. I am going to try again with data-encoding which looks reasonable.

roderickvd commented 10 months ago

Thanks for the work. Changing the OS requires work on a couple of different places where it's announced or in some header. Maybe that's what kept it from working for you.