Or if you want something less "obvious" than a CRC32
"Less obvious" is a tough job in an embedded system unless you have blown the security fuses, because any "key" will always be discoverable by disassembly. Well, unless you have a smart card chip there, but that's hassle for a simple thing like this.
having a database with your production info is a good idea.
It makes sense if most or all of your products are serialised. Many years ago, another company, we had a system developed which did the whole tracking job end to end, running on, believe it or not, an AS/400. Barcode scanners, etc. Eventually it was abandoned due to complexity.
making them impossible to modify or erase
IME, this
is a real point. We had customers dismantling the units and exchanging the part of the case which had the S/N sticker on it, to get a S/N which was still within warranty (they were blowing them up due to wrong installation, etc). I caught them out because we also wrote the S/N into an EEPROM.
In this case the S/Ns come off a printed sheet of stickers, obviously sequentially, and the person doing the production test enters the number into a factory test dialog. I think I will stick with this system. Stuff like the CPU ID is useful for some anti counterfeiting measures