• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Proquint — Int to a readable string and back again

olive

Member
3rd Party Module Dev
Tutorial Author
Patreon Bronze
Joined
Jul 17, 2017
Messages
76
I would be surprised if this ends up being useful to anybody else, but I implemented Proquints in cxs. They're useful for getting a pronounceable string out of an integer & be able to get the int back from that string.

I'm using it to make unique number IDs something I can show to the user & not have it be too computer-y.

I think I got the order of the information a little off from the official implementation (only having signed ints to work with also makes it a little different & a little funky at really high numbers), but it was close enough for my purposes.

Some example output:
Code:
QUINT of '0' : 'babab-babab'
INT of 'babab-babab' : '0

QUINT of '5' : 'babab-babaj'
INT of 'babab-babaj' : '5

QUINT of '303240362' : 'damig-difop'
INT of 'damig-difop' : 303240362

QUINT of '2147483646' : 'luzuz-zuzuv'
INT of 'luzuz-zuzuv' : 2147483646

QUINT of '2147483647' : 'luzuz-zuzuz'
INT of 'luzuz-zuzuz' : 2147483647

QUINT of '2147483648' : 'mabab-babab'
INT of 'mabab-babab' : -2147483648
 

Attachments

  • proquint.zip
    45.1 KB · Views: 138
Back
Top Bottom