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: * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/index/index.go#L33 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L62 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L258C14-L258C19 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L281 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/index/index.go#L34 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L63-L64 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L259C14-L259C23 * https://github.com/readium/readium-lcp-server/blob/f56eaae46535cf3729e0d60a2f474e98dcf6effe/license/license.go#L282 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
https://readium.org/lcp-specs/releases/lcp/latest.html#35-pointing-to-external-resources-the-links-object
length-Content length in octets-Integerhash-SHA-256 hash of the resource-Base 64 encoded octet sequence"example 3":
...as you can see, the example shows
hashas a hex-encoded value, not b64. Furthermore,lengthis a string, not an integer.The Go implementation produces
hashas hex-encoding, andlengthas 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:
lengthexample by replacing the string with an integer