2012-07-25, 15:19
Hi.
I want to know the hash coded name for a thumbnail.
I have found this in the wiki :
http://wiki.xbmc.org/index.php?title=Thumbnails#Hashing
So I make some tests with Python :
As espected, hash code is :
But I want to find the thumbnail for this picture : C:\TV\TF1.tbn
So same function in Python :
And result :
But the correct file in thumbnail folder is XBMC\userdata\Thumbnails\Video\11c05c994.tbn
I want to know the hash coded name for a thumbnail.
I have found this in the wiki :
http://wiki.xbmc.org/index.php?title=Thumbnails#Hashing
So I make some tests with Python :
Code:
def get_crc32( string ):
string = string.lower()
bytes = bytearray(string.encode())
crc = 0xffffffff;
for b in bytes:
crc = crc ^ (b << 24)
for i in range(8):
if (crc & 0x80000000 ):
crc = (crc << 1) ^ 0x04C11DB7
else:
crc = crc << 1;
crc = crc & 0xFFFFFFFF
return '%08x' % crc
print ("CRC32=", get_crc32("F:\\Videos\\Nosferatu.avi"))
As espected, hash code is :
Code:
CRC32= 2a6ec78d
But I want to find the thumbnail for this picture : C:\TV\TF1.tbn
So same function in Python :
Code:
print ("CRC32=", get_crc32("C:\\TV\\TF1.tbn"))
And result :
Code:
CRC32= 2a6ec78d
But the correct file in thumbnail folder is XBMC\userdata\Thumbnails\Video\11c05c994.tbn