If someone else lands here, like me, using a Google search:
I confirmed that middaparka said above after updating my deviceβs iOS when my music app tried to use persistentIDs before the update. The identifiers changed, and I ended up (involuntarily) listening to many songs from my library that I usually donβt listen to ...
So, I took the advice of middaparka and created a permanent key, excluding hashes from the name, artistName, albumTitle and duration. Building a persistentKey during initialization of the base database will save time later by avoiding multiple string comparisons when typing items in "normal working code."
The persistentKey strategy worked correctly for songs. However, when I made a hash for the albums from the title, artist, and releaseYear, I ran into one collision.
I had two independent albums of different artists, released in 1976. When the hashes for the album title and the artist were exclusive, they cancel each other out. I ended up using a hash for a duration, not a performer, and it worked.
I can finish the refinement of the algorithm to generate persistentKeys later ...
Carl Smith
source share