Page 1 of 1

Unique id of a cell text in Excel?

Posted: Wed Jun 25, 2025 3:12 pm
by doctorized
I am member of a group that organizes and conducts conferences. We have people that attend those conferences and those who present. We give certificates of attendance and contribution. The data are stored in excel sheets that are inserted in MS Word via Email Merge and using Adobe Acrobat Pro we create and send these certificates as attachments in email. I am thinking of creating a webpage where every participant will be able to download their own certificate and confirm authenticity of any certificate. I need to create a unique identifier for every certificate. If Excel could create crc32 value of the last and first name would be perfect. I am looking for something that is going to create a unique identifier and not just an increment number like 001, 002, 003, etc. I want a small id (up to 8 or 10 characters) that will be written in some inquiry text box easily. I don't mind if it is going to be some hex value or some text [a-z][A-Z][0-9]. Any thoughts?

Re: Unique id of a cell text in Excel?

Posted: Wed Jun 25, 2025 3:44 pm
by NicTheQuick
The best way would be to create just random numbers of a certain size which can not easily be iterated through.

But if you want to make it based on their names, use a simple Hash algorithm like SHA1 or higher and add to each name a longer string which nobody knows except you or else someone could download the certificate of another person just by knowing their name.

I know it's Off Topic but here is an example using Purebasic:

Code: Select all

#secret = "qC375pvcZrkkWEu7whzDeAUwL4DXfSJp7kSMYEoZS47eTwAqEkJ4UPvbcbYYSwe4"

UseSHA2Fingerprint()

Procedure.s nameId(name.s, size.i)
	ProcedureReturn Left(StringFingerprint(name + #secret, #PB_Cipher_SHA2, 256, #PB_UTF8), size)
EndProcedure

Debug nameId("doctorized", 10)
Debug nameId("NicTheQuick", 10)
Debug nameId("Fred", 10)

Re: Unique id of a cell text in Excel?

Posted: Wed Jun 25, 2025 4:52 pm
by doctorized
NicTheQuick wrote: Wed Jun 25, 2025 3:44 pm ...
I know it's Off Topic but here is an example using Purebasic:

Code: Select all

....
I know how to do it in PB. The point is to do it in Excel.....

Re: Unique id of a cell text in Excel?

Posted: Wed Jun 25, 2025 5:53 pm
by NicTheQuick
I see. Google found me this: https://stackoverflow.com/questions/349 ... 3#72312483

Since I don't own Windows, nor Excel, I can only search for solutions.

In any other case, ask your favorite AI I guese.

Re: Unique id of a cell text in Excel?

Posted: Thu Jun 26, 2025 1:45 am
by Olli
Crc32 ?
Gave a way here if you can translate all these purebasic operations :

Code: Select all

Procedure RoutineCRC32(*Message)

            Contagem = MemorySize(*Message)
            RESI = *Message
            REDX = -1
            Repeat
                  REAX = PeekA(RESI)
                  RESI + 1
                  RECX = REDX
                  REAX & $FF
                  RECX & $FF
                  REAX ! RECX
                  REDX >> 8
                  REDX ! PeekL(REAX << 2 + CrcTable)
                  Contagem - 1
            Until Contagem = 0
      EndWith

EndProcedure

Re: Unique id of a cell text in Excel?

Posted: Thu Jun 26, 2025 8:52 am
by Olli
Ups... I apologize : it s CRC32 reversing.

The main problem on Excel is :

1st) Have you got the ability to nest a {while... wend} loop or equ in a cell/column ?
2nd) Not absolutely required but, if a binary rotation would exist, it could be "plus".

@nicTheQuick

very good link (and sub-link).