# Q about hash

**URL:** <https://forums.plex.tv/t/q-about-hash/48319>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [November 30, 2013, 1:51pm UTC](https://forums.plex.tv/t/q-about-hash/48319 "2013-11-30T13:51:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 30, 2013, 1:51pm UTC](https://forums.plex.tv/t/q-about-hash/48319/1 "2013-11-30T13:51:17Z")

</div>

And no.....Not starting a thread here about if it should be legal or not, but about the hash value for meta-data found in the media\_parts table

&nbsp;

If I got a media named x.mkv, then what's the formula behind generating the hash value?

&nbsp;

So far I tried the following:

&nbsp;

MD5

SHA1

SHA224

SHA384

SHA256

SHA512

&nbsp;

Yet still no luck :(

&nbsp;

Any insights here?

&nbsp;

Best regards

&nbsp;

Tommy

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![ljunkie](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ljunkie/32/6512_2.png) [@ljunkie](https://forums.plex.tv/u/ljunkie)\
**Post date:** [November 30, 2013, 5:42pm UTC](https://forums.plex.tv/t/q-about-hash/48319/2 "2013-11-30T17:42:30Z")

</div>

> And no.....Not starting a thread here about if it should be legal or not, but about the hash value for meta-data found in the media\_parts table  
>   
> If I got a media named x.mkv, then what's the formula behind generating the hash value?  
>   
> So far I tried the following:  
>   
> MD5  
> SHA1  
> SHA224  
> SHA384  
> SHA256  
> SHA512  
>   
> Yet still no luck :(  
>   
> Any insights here?  
>   
> Best regards  
>   
> Tommy

  
Last time I figured this out, I think it was the sha1 of the guid field in the metadata\_items table.   
  
i.e.   
  
echo -n "com.plexapp.agents.imdb://tt0838283?lang=en" | shasum

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 30, 2013, 8:08pm UTC](https://forums.plex.tv/t/q-about-hash/48319/3 "2013-11-30T20:08:04Z")

</div>

Interesting......

But sadly a no-go

Also tried other versions of sha against the guid string.....

And sadly also a bit un-logical to me, since the index is stored in the meta-data dir, and an index is only valid for a specific version of a movie etc, depending on resolution, encoding etc, or ?

But thanks for the idea......it actually caused the amount of thought to multiply by a 1000 here :D

/Tommy

---

<div class="post-metadata">

**Author:** ![ljunkie](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ljunkie/32/6512_2.png) [@ljunkie](https://forums.plex.tv/u/ljunkie)\
**Post date:** [November 30, 2013, 8:22pm UTC](https://forums.plex.tv/t/q-about-hash/48319/4 "2013-11-30T20:22:56Z")

</div>

> Interesting......
> 
> But sadly a no-go
> 
> Also tried other versions of sha against the guid string.....
> 
> And sadly also a bit un-logical to me, since the index is stored in the meta-data dir, and an index is only valid for a specific version of a movie etc, depending on resolution, encoding etc, or ?
> 
> But thanks for the idea......it actually caused the amount of thought to multiply by a 1000 here :D
> 
> /Tommy

The first character of the hash is the folder, the next part is the sub folder. It works for me in the past, maybe it changed. Move info here:&nbsp;[http://nikansell.wordpress.com/2012/03/14/fixing-corrupt-plex-thumbnails/](http://nikansell.wordpress.com/2012/03/14/fixing-corrupt-plex-thumbnails/)

Edit: you are right about the multi version and the index maybe being wrong, but I think that is just how it works. I don't think plex creates separate indexes per media file.&nbsp;

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 30, 2013, 8:29pm UTC](https://forums.plex.tv/t/q-about-hash/48319/5 "2013-11-30T20:29:43Z")

</div>

> The first character of the hash is the folder, the next part is the sub folder. It works for me in the past, maybe it changed. Move info here:&nbsp;[http://nikansell.wordpress.com/2012/03/14/fixing-corrupt-plex-thumbnails/](http://nikansell.wordpress.com/2012/03/14/fixing-corrupt-plex-thumbnails/)
> 
> Edit: you are right about the multi version and the index maybe being wrong, but I think that is just how it works. I don't think plex creates separate indexes per media file.&nbsp;

Holly crap.....the link you just provided reviled info I've used + 3 month to figure out, and posted here:

[https://forums.plexapp.com/index.php/topic/86694-sharing-info/?p=501898](https://forums.plexapp.com/index.php/topic/86694-sharing-info/?p=501898)

Man....I re-invented the wheel.....

Anyway, my first initial tests showed it wasn't so, but I'll dig into this again, since it's highly unlikely for Plex to change this on the way.....

As Arnold said...."I'll be back"

/Tommy

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 30, 2013, 8:41pm UTC](https://forums.plex.tv/t/q-about-hash/48319/6 "2013-11-30T20:41:26Z")

</div>

Okay.....Plex did change this.

This is from the GUID field:

[http://com.plexapp.agents.imdb://tt0114746?lang=en](http://com.plexapp.agents.imdb//tt0114746?lang=en)

SHA1 produce:

9ab6c1ce14829ee5316ee438a554a3dea7eccc8e

The wanted outcome was however:

fc4848b897690a5b1c4c10a3151e245e676badae

So kinda stucked here....again....SIGH.....

/Tommy

---

<div class="post-metadata">

**Author:** ![ljunkie](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ljunkie/32/6512_2.png) [@ljunkie](https://forums.plex.tv/u/ljunkie)\
**Post date:** [November 30, 2013, 8:58pm UTC](https://forums.plex.tv/t/q-about-hash/48319/7 "2013-11-30T20:58:34Z")

</div>

> Okay.....Plex did change this.  
>   
> This is from the GUID field:  
>   
>   
> [http://com.plexapp.agents.imdb://tt0114746?lang=en](http://com.plexapp.agents.imdb//tt0114746?lang=en)  
>   
> SHA1 produce:  
>   
> 9ab6c1ce14829ee5316ee438■■■4a3dea7eccc8e  
>   
> The wanted outcome was however:  
>   
> fc4848b897690a5b1c4c10a3151e245e676badae  
>   
> So kinda stucked here....again....SIGH.....  
>   
> /Tommy

  
Yea, I don't recall a hash being available in the DB before, so maybe that's why it's included now in the parts table. Either way would have to access the DB, so I'm guessing it wouldn't of helped right?

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 30, 2013, 9:02pm UTC](https://forums.plex.tv/t/q-about-hash/48319/8 "2013-11-30T21:02:04Z")

</div>

> Yea, I don't recall a hash being available in the DB before, so maybe that's why it's included now in the parts table. Either way would have to access the DB, so I'm guessing it wouldn't of helped right?

Nope...It would have been a great help, since the guid can be accessed via http, thus avoiding access to the database.

Still hoping, that some dev want's to protect everybody's database from my lousy code though, and share some light here :D

Or expose the other field to the http api

/T

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 12:33am UTC](https://forums.plex.tv/t/q-about-hash/48319/9 "2019-12-21T00:33:36Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
