How to convert from php ASCII to hex

Hello,

Example: how do I get the 2 character hex value of this “AF220413172313” text

As this online converter gives

I will use this as document number

Example my document number will be like this
AF2204131C

What you have shown is not a real hex value. It is calculated with the formula described on the page.

How about telling us about the real problem you are trying to solve by doing this.

I want to generate unique document number
I want the document number to be both short and unique.
The document number will have the date and the last two characters will be hex for uniqueness.

I want to create a document number by taking the hex of this “AF(year)22(month)04(day)26(hour)10(minute)36(second)50” =>“AF220426103650” value and adding it to the following value

AF2204261A
This way I think I can get a short, unique and readable document number

Sponsor our Newsletter | Privacy Policy | Terms of Service