Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link hash SHA256 base64 encoding, and length integer #57

Open
danielweck opened this issue Nov 28, 2024 · 0 comments
Open

link hash SHA256 base64 encoding, and length integer #57

danielweck opened this issue Nov 28, 2024 · 0 comments

Comments

@danielweck
Copy link
Member

danielweck commented Nov 28, 2024

https://readium.org/lcp-specs/releases/lcp/latest.html#35-pointing-to-external-resources-the-links-object

length - Content length in octets - Integer

hash - SHA-256 hash of the resource - Base 64 encoded octet sequence

"example 3":

    { "rel": "publication",
      "href": "https://www.example.com/file.epub",
      "type": "application/epub+zip",
      "length": "264929",
      "hash": "8b752f93e5e73a3efff1c706c1c2e267dffc6ec01c382cbe2a6ca9bd57cc8378"
    },

...as you can see, the example shows hash as a hex-encoded value, not b64. Furthermore, length is a string, not an integer.

The Go implementation produces hash as hex-encoding, and length as number value:

See examples of LCP license JSONs generated by the Go implementation:

https://www.edrlab.org/readium-lcp/testing-readium-lcp-compliant-devices/

Suggested fix:

  1. replace "base64" with "hex encoding"
  2. fix the length example by replacing the string with an integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant