Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-03-2014, 01:10 PM   #1
Adam23
Junior Member
Adam23 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: K3, K4
Trying to pair filename and sha1 hash in collections.json

Hello.

I was pointed to this amazing forum to find answers to my problem

I need to identify which sha1 hash in collections.json file in Kindle belongs to which ebook file.
I understand the hash is generated from the path to the file in Linux file system. However, there is some step in the process that Kindle uses, when handling spaces and dashes? I am unable to obtain the proper hashes. I have tried many online tools, and kindle collections, but none of them generated the right hashes.

For example for the path to: /mnt/us/documents/Orwell, George/1984 - George Orwell.mobi

the corresponding hash should be: f20904d7-b190-40f0-96a5-ea79b73a9997

Is there any online tool or a simple script/program that really works? Or am I doing it wrong?

Thanks for any useful advice/help!
Adam23 is offline   Reply With Quote
Old 02-03-2014, 07:16 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 5,241
Karma: 5164853
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2; Kobo H2O
@Adam23: In your example, that's not the sha1 hash of the absolute path, that's the ASIN (in this case, a fake ASIN created by Calibre from an UUID). The sha1 thing is now a fallback when the book doesn't have an ASIN set in its metadata, and used to be preceded by a star in the old format. Can't remember how the SQL-ized version on FW 5.x handles it.

Check the Kindle Collections plugin for the gory details.
There's surely some smaller and simpler, but older, pieces of code laying around that handle the basics, but the Kindle Collections Calibre plugin is the only one that's still maintained, and AFAIK, probably the most complete & accurate one.

Last edited by NiLuJe; 02-03-2014 at 07:22 PM.
NiLuJe is online now   Reply With Quote
Old 02-11-2014, 01:09 PM   #3
Adam23
Junior Member
Adam23 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2014
Device: K3, K4
Thanks for your response, but I still couldn't figure out why some books were identified by ASIN or by the hash numbers. Finally, I decided not to follow this path. I instead manually adjusted each file.
Adam23 is offline   Reply With Quote
Old 02-11-2014, 03:31 PM   #4
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 5,241
Karma: 5164853
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2; Kobo H2O
FWIW: If the ASIN is set in the metadata, it's used, if it's not, the fallback to the sha1 sum is used instead.
NiLuJe is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting who provide the file in /usr/share/webkit-1.0/pillow/debug_cmds.json hanpal Amazon Kindle 3 02-21-2012 05:21 AM
sha1 on kindle? dubaaron Kindle Developer's Corner 2 02-17-2011 01:50 PM
Generate hash codes for Dictionaries? meme Kindle Developer's Corner 0 02-01-2011 05:38 PM
Force reloading collections.json enn Kindle Developer's Corner 2 10-03-2010 07:57 PM
post the root hash from your K3 blkhawk Kindle Developer's Corner 7 09-20-2010 11:26 PM


All times are GMT -4. The time now is 05:02 PM.


MobileRead.com is a privately owned, operated and funded community.