Unique id of a cell text in Excel?

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Unique id of a cell text in Excel?

Post 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?
User avatar
NicTheQuick
Addict
Addict
Posts: 1519
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Unique id of a cell text in Excel?

Post 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)
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

Re: Unique id of a cell text in Excel?

Post 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.....
User avatar
NicTheQuick
Addict
Addict
Posts: 1519
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Unique id of a cell text in Excel?

Post 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.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Olli
Addict
Addict
Posts: 1240
Joined: Wed May 27, 2020 12:26 pm

Re: Unique id of a cell text in Excel?

Post 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
Olli
Addict
Addict
Posts: 1240
Joined: Wed May 27, 2020 12:26 pm

Re: Unique id of a cell text in Excel?

Post 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).
Post Reply