Open danielweck opened 5 years ago
Typescript:
if (prop.Compression.Method === "8") {
encrypted.Compression = "deflate";
} else {
encrypted.Compression = "none";
}
Go:
if prop.Compression.Method == "8" {
encrypted.Compression = "deflate"
} else {
encrypted.Compression = "none"
}
Kotlin:
encryption.compression = if (method == "8") "deflate" else "none"
Swift:
encryption.compression = (method == "8" ? "deflate" : "none")
OK, I'm fine using none
as well, it just needs to be documented.
How far do we want to go though in the JSON Schema? Should we limit this value to an enum with only deflate
and none
?
I think this is safe for now. http://www.idpf.org/epub/31/spec/epub-ocf.html#sec-enc-compression
Value is either "0" (no compression) or "8" (Deflate algorithm).
It's safe for EPUB but we might need to support other packaging formats in the future.
https://github.com/readium/webpub-manifest/blob/master/extensions/epub.md#encrypted
The current Readium2 TypeScript / NodeJS implementation uses "none", not "store". Update: Kotlin, Swift and Go too.