Author Topic: Unique ID  (Read 3056 times)

Offline wdp

  • Newcomer
  • *
  • Posts: 8
    • View Profile
Unique ID
« on: October 26, 2020, 07:10:32 PM »
I searched around a lot, and just wanted to ask after not turning up a clear answer.  Is there a way to generate a random unique ID in a filename?

Like if I wanted to do TIMESTAMP_UniqueID.cr2, but only have a 4 digit unique ID or repeating counter? sequences just keep counting, so unless I set it to 5 digits, the length of my filenames change over time.

I was trying to get away without an counter, but subsecond depending on the camera/brand just isn't dependable.

This is for a particular use-case for large sporting events, where I have cards from multiple photographers coming in. They'll blast through 50k photos in 3 days easy. I just thought a Unique ID or random ID would be nice.  Sequence stuff I just end up forgetting to reset or set to 5 digits, etc. But I guess they act the same.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24989
    • View Profile
    • Camera Bits, Inc.
Re: Unique ID
« Reply #1 on: October 26, 2020, 07:20:38 PM »
I searched around a lot, and just wanted to ask after not turning up a clear answer.  Is there a way to generate a random unique ID in a filename?

Like if I wanted to do TIMESTAMP_UniqueID.cr2, but only have a 4 digit unique ID or repeating counter? sequences just keep counting, so unless I set it to 5 digits, the length of my filenames change over time.

I was trying to get away without an counter, but subsecond depending on the camera/brand just isn't dependable.

This is for a particular use-case for large sporting events, where I have cards from multiple photographers coming in. They'll blast through 50k photos in 3 days easy. I just thought a Unique ID or random ID would be nice.  Sequence stuff I just end up forgetting to reset or set to 5 digits, etc. But I guess they act the same.

{rand1000} could be used and it is zero padded, 0001 through 1000.  PM doesn't offer a unique ID generator, but it does have a variable called {uniqueid} that some cameras produce.

Otherwise, you could use the serial number of the camera either directly {serialnum} or use it in conjunction with Code Replacement to customize your filenames further.

HTH,

-Kirk