question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hash should be an object

See original GitHub issue

We currently support a special prefixing on the hash to declare hashing algorithms the are not MD5. However, we are moving away from this type of overloading in most all places in the spec.

So, I suggest:

"hash": {
  "type": "md5",
  "value": "{HASH}"
}

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fjuniorrcommented, Sep 10, 2021

@rufuspollock and @roll did this ever make to (some version) of the specs?

I’ve noticed that if I read a data package with frictionless.py with a string value in the hash property it will convert it to an object and add a hashing property.

That is, this datapackage.json

{
  "profile": "data-package",
  "resources": [
    {
      "profile": "data-resource",
      "name": "estados",
      "path": "estados.csv",
      "hash": "sha256:c280dab2e21da93be52aef5a4c934abdd4d70d9981f59372e3f36f4ca8b1ac38"
    }
  ],
  "name": "datapackage-reprex"
}

After

from frictionless import Package

dp = Package('datapackage.json')

dp.to_json('datapackage.json')

is serialized as

{
  "profile": "data-package",
  "resources": [
    {
      "profile": "data-resource",
      "name": "estados",
      "path": "estados.csv",
      "hashing": "sha256",
      "stats": {
        "hash": "c280dab2e21da93be52aef5a4c934abdd4d70d9981f59372e3f36f4ca8b1ac38"
      }
    }
  ],
  "name": "datapackage-reprex"
}

I’m starting to use this in a production context and it would be nice to know the recommended approach moving forward.

0reactions
rufuspollockcommented, Aug 23, 2022

@rgaiacs stats stuff is #364 i think. Do you want to comment there (especially on what you’d like to see)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Objects.hash() vs Objects.hashCode() - Baeldung
A hashcode is a numeric representation of the contents of an object. In Java, there are a few different methods we can use...
Read more >
object-hash - npm
Generate hashes from javascript objects in node and the browser. ... Start using object-hash in your project by running `npm i object-hash`.
Read more >
puleos/object-hash: Generate hashes from javascript ... - GitHub
Generate hashes from javascript objects in node and the browser. ... and a stronger algorithm should be used if a cryptographical hash is...
Read more >
Difference between an object and a hash? - Stack Overflow
Actually, every object in JavaScript IS a hash. This is a hash of object's properties and methods. In fact ...
Read more >
hash | Apple Developer Documentation
Returns an integer that can be used as a table address in a hash table structure.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found