Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I convert a CFUUID to 30 characters or less?

I need to create an identifier for my iOS user that is unique. Unfortunately the database that it will be saved to has a set length of 30 characters and CFUUID's are 36 (32 if removing the dashes).

Is there a way to make it into a smaller string? I think CFUUID's are hex, so would it be possible to convert it to full ASCII?

like image 863
Luke Avatar asked Dec 31 '25 05:12

Luke


1 Answers

Jeff Atwood covers this in Equipping our ASCII Armor. A Base64 encoded GUID results in 22 (24 including ==) bytes. There are also other ascii formats you can use based on the post but Base64 will likely be the friendliest with the database server.

like image 62
Joe Avatar answered Jan 02 '26 17:01

Joe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!