How are asset IDs actually calculated? #1427
-
From what I know, when you download an SB3 file, it's a zip with project.json, along with the MD5 of all costumes and sprites. Just for the heck of it, I wanted to see if it was possible to build an SB3 in turbowarp. While doing some testing however, I found that using the encoding extension to get the MD5 of the costume name. While looking at the exact same sprite in an SB3 (converted to zip) the file name doesn't match up. I figure it most be of the content stored within the sprite, which makes more sense anyway, so I try with just the straight content. Hash it with MD5 using encoding, and it still doesn't match up. Ok, it must be the URL data. It makes as much sense as the content, so I try that, and it still doesn't match up. None of them matched up, and either I'm doing something wrong, or possibly there's an issue with the encoding extension. I didn't want to make an issue however as I feel this is likely an error on my part and I've made 4 in the past week. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I may delete, as for whatever reason it seems to work with a blank project and the default sprite. |
Beta Was this translation helpful? Give feedback.
-
They're the MD5 hash of the asset content (not name). If that doesn't work then you're probably doing something wrong (e.g if you're converting the content into a raw string then MD5ing that, don't, because binary data doesn't really work well in raw strings). |
Beta Was this translation helpful? Give feedback.
-
If anyone else has this hyper-specific issue it can be fixed using the assetid block in asset manager which I SOMEHOW missed |
Beta Was this translation helpful? Give feedback.
They're the MD5 hash of the asset content (not name). If that doesn't work then you're probably doing something wrong (e.g if you're converting the content into a raw string then MD5ing that, don't, because binary data doesn't really work well in raw strings).