taoensso / nippy

The fastest serialization library for Clojure
https://www.taoensso.com/nippy
Eclipse Public License 1.0
1.04k stars 60 forks source link

Is nippy serialization canonical? #86

Closed lvh closed 8 years ago

lvh commented 8 years ago

Does (= a b) imply that (= (freeze a) (freeze b))? (This is an important property for some cryptographic applications.)

lvh commented 8 years ago

Sorry; the real property is a little bit stronger: is a serialization canonical? That seems to be trivially not true if you let people pick compressors; but assuming the compressor is fixed?

ptaoussanis commented 8 years ago

Hi there, Nippy unfortunately makes no promises on this since it's not a primary objective and may be difficult to promise in general.

As an implementation detail, such equality should hold for most simple data types.

If you have cryptographic requirements, would recommend using an appropriate hash designed for the application.

On Aug 30, 2016 00:16, "lvh" notifications@github.com wrote:

Sorry; the real property is a little bit stronger: is a serialization canonical? That seems to be trivially not true if you let people pick compressors; but assuming the compressor is fixed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ptaoussanis/nippy/issues/86#issuecomment-243189609, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJxC4gMkpVbwRPn1z6mPHYC5NWRy40Nks5qkxP9gaJpZM4Jvrqh .

lvh commented 8 years ago

Thanks! Not particularly disappointing -- I have experience with canonicalizing serializers, so I was expecting as much.