-
Notifications
You must be signed in to change notification settings - Fork 5
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 resource hash is base64 encoded? #52
Comments
Go source code reference: encryptedFileInfo.Sha256 = hex.EncodeToString(hasher.Sum(nil)) |
Related issue: ...and important observation: the base64 encoding layer applies to the hex buffer, not to the hex string! |
Hello @mickael-menu I searched https://github.com/readium/r2-lcp-kotlin and https://github.com/readium/r2-lcp-swift but I could not find usages of the LCP license |
I don't think we ever used By the way the updated repos are https://github.com/readium/kotlin-toolkit and https://github.com/readium/swift-toolkit |
What's the purpose of base 64 encoding the |
Same reasons as lcp_hashed_passphrase? |
The hex implementation in the Go server is from 2016 and indeed I don't know why it is using hex encoding and not base64. I didn't spot the issue before. In the LCP spec, the note that in Golang, JSON marshaling of byte arrays is using base64, this is why |
According to the specification and JSON schema, the answer is yes:
lcp-specs/schema/link.schema.json
Lines 42 to 46 in 9337294
https://github.com/readium/lcp-specs/blob/master/releases/lcp/lcp-1-0-3.md#link-object
However the LCP Go server implementation encodes the
hash
property as the hexadecimal string representation of the SHA256 digest:Which is correct?
The text was updated successfully, but these errors were encountered: