+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  SHA1 hash - help
Pages: 1 [2]
Author Topic: SHA1 hash - help  (Read 1129 times)
Special T
Guest
« Reply #15 on: October 29, 2006, 01:27:25 pm »

Thanks, I wasn't aware of that, you probably just saved me from a huge head ache.

The archive I plan to create will have some translated roms as well, so maybe I could use a combination of name and number.

The name for patched type roms
CRC32 or MD5 for non patched roms
Nightcrawler
Guest
« Reply #16 on: October 29, 2006, 02:23:34 pm »

Is this going to be stored in a database? I don't know why you need to use ANY of those three choices for a unique identifier if it is. If it's not going in a database, how do plan on storing this stuff?

We have a simple games database which assigns a unique number to each game.  We have a screenshot table where each screenshot(also with unique number) is linked to one of the unique games. In the case of translation or hacks, once again, unique numbered translations/hacks are linked to one of the unique numbered games. It's quite simple then for everything to be cataloged uniquely.

I'm sure you could come up with something even better and smarter than that if you read some database design documents.

I'm I'm totally off base here and you're doing something different and not using a database, then please explain.
Special T
Guest
« Reply #17 on: October 29, 2006, 07:25:35 pm »

You got it; I’ll be using the gamefront database for my picture archive / rom manager.

This database allows me to scan a rom folder and import the contents to an MS Access database.

So let’s just say I have 50 Genesis roms from the GoodGEN set version 1.0. So I use Gamefront to scan the folder and upload them to the database using their current names and giving them each a unique number 1-50.

Then version 2.0 of GoodGEN gets released and 10 of those games get renamed. When I rescan the rom folder it will upload the newly named games as 10 extra games that don’t exist making it appear I have 60 games, when in actuality I only have 50.

The database will list those extra roms as 51 – 60. This means that none of the pictures for the original roms will correspond to the newly labeled roms because of their new numbers.

So I’ll have to go back and delete the 10 originally named roms from the database, which is no big deal but after that I will have to re-label all my pictures to 51, 52, 53 etc.

Now if I have hundreds of roms images to rename this will be a lot more time consuming.

To save me from doing even more work of manually renaming all the pictures I would like to assign a number that wouldn’t change even if the name does so even if I have roms from 51-60 the pictures corresponding to the original roms would still show up for the newly named ones. So when I delete the old ones I don’t have to worry about re-labeling the pictures.

I’m not sure if any of these (SHA1 Hash, CRC32, or MD5) stay constant when the name changes. I would also need something that is easy to locate as well.

Sorry for the long post but I wanted to make sure it made sense.
Aerdan
Guest
« Reply #18 on: October 29, 2006, 08:07:14 pm »

They stay constant regardless of the filename, yes.

I'd suggest storing two hashes, one CRC32, one whatever you like, if only because you reduce the risk of hash collision [where two completely different files coincidentally have the same hash].
creaothceann
Guest
« Reply #19 on: October 30, 2006, 03:15:14 am »

Quote from: Special T on October 29, 2006, 07:25:35 pm
I’m not sure if any of these (SHA1 Hash, CRC32, or MD5) stay constant when the name changes.

Have you looked at the functions that perform these operations? They expect a pointer and a length value, ie. a memory block. There is just no way the filename could be involved, unless you somehow include it into the block. Roll Eyes
Nightcrawler
Guest
« Reply #20 on: October 30, 2006, 10:54:59 am »

Ok.. well how about I state the obvious here..

You may as well set your database up to mimic GoodGEN's database as closely as possible since that's your source material. List the checksum used there or any other unique information present so you can easily determine if an entry has changed or it is new.

You may even try and get some internal information on the GoodGEN database. How does it keep track of it's own entries when renamed or new etc?
Special T
Guest
« Reply #21 on: October 30, 2006, 05:33:17 pm »

That's a great idea thanks
Pages: 1 [2]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC