I have a set of unit tests that saves data in DB (postgres) whenever they run. once in a while, because of some duplicate data, the machine performance is slowed, so we need to clean the db (the data is not important but it needs to be saved for a while for internal process).
I thought, as a temporary solution, to extend the time period from deleting the data, to generate a hashing id in my for each record that is saved in DB, to avoid duplication(so if the hashed id exists, it wouldn't be saved).
I know that a different set of data might produce same hashed id - it's ok, I'll handle this logic.
I need to generate those hashed id's, in java, it needs to be in range of type long. java's built in method "Objects.hash()" produces results of type int. any other solutions I looked for are using UUID or any other hashing algorithms which produces sequence of characters.