3

Disclaimer: hobbyist here, not a professional programmer. Working on a pet project, nothing that would be useful in the real world.

I'm trying to determine whether the hashes in the url of a tumblr image are in any way related to the contents of the image itself. A typical url looks like this:

media.tumblr.com/3b675b5cdc9c6f9414626ba7e0c62f96/tumblr_n8949eWEIi1rw1wnno1_400.gif

As you can see, there's a 32-character hash and another 19-character hash. I've tried all of the hashing algorithms supported by PHP 5.4.24, but none of them produces either of these codes. I've looked at the useless tumblr api, and done some searching around, but I can't find anything about how these codes are generated. Does anyone outside of tumblr know?

SaganRitual
  • 3,143
  • 2
  • 24
  • 40
  • I am not 100% sure they use PHP for hashes: http://www.quora.com/Tumblr/What-is-Tumblrs-technology-stack Sadly it seems its a big secret, wish I could be more help. – mikedidthis Jul 07 '14 at 14:48

2 Answers2

1

I doubt that it's just a hash of the content, people upload duplicates all the time and it has to result in a different url. They are likely randomly generated numbers.

fregante
  • 29,050
  • 14
  • 119
  • 159
0

I am looking into this right now.

According to this Image URL Naming Scheme the "path hash" is generated from the sha1sum of the original uploaded file (not the resized _1280 one).

URL | Post ID https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_o52i3aUCp21s6b18b_raw.png 142356364280 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_o5p15wTJvV1s6b18b_raw.png 142862598358 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_o6krbiugVC1t8vyl1_raw.png 143764052781 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_o8b40w7wGg1t8vyl1_raw.png 145458898886 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_o8ze2tfKNF1t8vyl1_raw.png 146118662296 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_odemy29NAE1tnns90_raw.png 150330941101 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_oeca19dxFg1t8vyl1_raw.png 151163621951 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_oefltuWf7l1t8vyl1_raw.png 151247611726 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_ofvlu8QK0T1sjl8et_raw.png 152521367261 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_oio5kwLNvv1t8vyl1_raw.png 154875513091 https://data.tumblr.com/20b42c7d2d3613dbd9450b5a506cfbd3/tumblr_inline_p1brk7DTpU1tdsqfw_raw.png 168794714560

the Post ID is what you get in a typical tumblr API response.

Another proof that the original file's content is used for generation: https://data.tumblr.com/20aa2775a98061db21f6f86ad46df399/tumblr_noafrk8hB41uowduuo1_r1_raw.png 118859314504 https://data.tumblr.com/20aa2775a98061db21f6f86ad46df399/tumblr_o87jds0wPW1uowduuo1_raw.png 145364317345

The r1 means revision number 1, the file has been altered by the original author, but the path hash and filename are kept the same.

Hernn0
  • 89
  • 1
  • 8