Open ghost opened 11 years ago
Django has a BinaryField coming Soon™ (it's marked "Ready for checkin" on their issue tracker). In the meantime, I think storing the piece hash as a hex representation is fine.
Cool, we can just wait for that then. I'll leave this issue open so that we remember to do this in the future.
In https://github.com/wafflesfm/batter/blob/develop/batter/torrents/views/upload.py#L68
It would be much more efficient to just store this as binary, and if a textual representation is needed later just to convert it on the fly. I know that Django doesn't have a built-in thing for this, but IMO it's worth having to specialize some of the DB stuff to reduce the size by half. Comments regarding this @Ell?
If for some reason this isn't possible, at least base64 or better should be used.