开发者

secure hash as database table key

开发者 https://www.devze.com 2023-04-13 03:53 出处:网络
I have a database table that is populated by a long running process. This process reads external data and updates the records in the database. Instead of really updating the records, it is easier to c

I have a database table that is populated by a long running process. This process reads external data and updates the records in the database. Instead of really updating the records, it is easier to cascade-delete them and recreate. This way all the dependencies will be cleaned up too.

Each record has a un开发者_Python百科ique name. I need to find a way to generate identifiers for these records in such a way that the same names are identified by the same identifiers. So that the identifier stays the same when the record is deleted and recreated. I tried using slugs but they can become very long and Django's SlugField does not always work.

Is it reasonable to use a secure hash as the key? I could create a hash from the slug and use that. Or is it too expensive?

0

精彩评论

暂无评论...
验证码 换一张
取 消