CivPlatform / map-sync

Mod to sync map data with others instantly and privately, and update tiles for Leaflet/CivMap
GNU General Public License v3.0
28 stars 10 forks source link

Stop length-prefixing hashes #89

Closed Protonull closed 1 year ago

Protonull commented 1 year ago

This can be applied to other things too, of course, but didn't want to de-length-prefix everything at once.

Gjum commented 1 year ago

How have you tested this?

Protonull commented 1 year ago

How have you tested this?

What do you mean? It's in the specification.

image

Huskydog9988 commented 1 year ago

So basically it's just a header you're adding?

Protonull commented 1 year ago

Quite the opposite, I'm removing header information because the length is already known, so there's no need to prefix the data with its length.

Huskydog9988 commented 1 year ago

Lgtm then. Also why does it only use sha1? Isn't it deprecated?

Gjum commented 1 year ago

why does it only use sha1? Isn't it deprecated?

SHA1 is guaranteed to be implemented by every JVM, and we don't need any cryptographic capabilities from our hashing function as we only use it for content based indexing with a data size cap. Some context: https://git-scm.com/docs/hash-function-transition/2.23.0

Huskydog9988 commented 1 year ago

I think this is ready to merge then