Git Product home page Git Product logo

Comments (8)

int-72h avatar int-72h commented on August 17, 2024 1

I'll have this fixed hopefully by the end of today when I've smoothed off the edges of the GUI (though in hindsight I should've commited the fix first...)

from pytoast.

int-72h avatar int-72h commented on August 17, 2024

it wouldn't surprise me if the ordering isn't preserved in some places.

I'm pretty sure it is last time I checked, but I'll change this anyway as it'll make it clearer.
May bloat filesize a bit though.

from pytoast.

w3bb avatar w3bb commented on August 17, 2024

it wouldn't surprise me if the ordering isn't preserved in some places.

I'm pretty sure it is last time I checked, but I'll change this anyway as it'll make it clearer.

In the JSON specification it says its unordered, and doing a quick Google search I found people complaining their library doesn't preserve ordering.

May bloat filesize a bit though.

A trade could also be made. It would probably save more space to use, say, a smaller hash like MD5 (which should work fine for checking unintentional file corruption, and comparing files.)

from pytoast.

int-72h avatar int-72h commented on August 17, 2024

it wouldn't surprise me if the ordering isn't preserved in some places.

I'm pretty sure it is last time I checked, but I'll change this anyway as it'll make it clearer.

In the JSON specification it says its unordered, and doing a quick Google search I found people complaining their library doesn't preserve ordering.

Thats fair enough.

May bloat filesize a bit though.

A trade could also be made. It would probably save more space to use, say, a smaller hash like MD5 (which should work fine for checking unintentional file corruption, and comparing files.)

You're probably right but in the future if I did want to add signing for whatever reason it'd be easier to throw on if the hash to begin with was secure enough.
Reducing the digest size seems like a good idea but there may be some crippling issue with this I haven't realised yet probably.

from pytoast.

w3bb avatar w3bb commented on August 17, 2024

Actually, I should mention that having multiple keys that are the same are also a problem. Many libraries just put in the last or first occurance of an object with a duplicate key. Whether it's valid JSON is ambiguous at best. I think a more correct/idiomatic version would be something like this:

{
   "revisions": [
      {
         "revision": 1,
         "files": [
            {
               "file": "path/to/file",
               "digest": "DEADBEEF"
            },
            {
               "file": "path/to/other/file",
               "digest": "DEADBEEF"
            }
         ]
      },
      {
         "revision": 2,
         "files": [
            {
               "file": "path/to/file",
               "digest": "DEADBEEF"
            }
         ]
      }
   ]
}

from pytoast.

int-72h avatar int-72h commented on August 17, 2024

This does look a bit better actually.
It's also a bit harder to implement as the current code flow in the packer goes "handle file -> does it exist in the old one -> increment rev by one". I don't think this would be that hard actually but I'd like to get some other opinions on this first as I'd like the schema to be rock-solid so there's hopefully no more breaking changes. Adding an RFC tag.

from pytoast.

w3bb avatar w3bb commented on August 17, 2024

Might it be worth opening a separate issue for the schema in general?

from pytoast.

int-72h avatar int-72h commented on August 17, 2024

Good idea actually.

from pytoast.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.