Quote:
Originally Posted by elinares
I've tested both books with Calibre, it can not show or transform none of them. The unscrambling method described on sven.de/librie is exactly the same I implemented in LRFTools, but for some streams it does not work.
I'm going to pm you the books.
|
Thanks for the sample. I did a little debugging, and apparently the correct calculation looks like this:
Code:
uint8_t get_local_key(int streamlen, uint8_t key)
{
if ( key && key <= 0xF0u )
return streamlen % key + 0xF;
else
return 0;
}
Note the extra check and that only 8 bits of the key are used.