#what data type to use for storing ids?

1 messages · Page 1 of 1 (latest)

grand mortar
#

hi guys. in java code i will need to use/store ids, that look like 11000000035. what data type to use? long or just String? because int in my case doesnt have enough storage for symbols. thanks

cold forumBOT
#

<@&1004656351647117403> please have a look, thanks.

grand mortar
#

oh crap, it has long

#

but what about just using String?

fast sapphire
delicate flume
#

does it have UUID?

#

well, if long suits your needs, use that

leaden moss
#

This number looks like it represents something

#

You should probably make a custom datatype, that has a sufficiently good underlying type to store this value

humble rover
#

I suggest you use Long(Wrapper) instead of long(primitive) as well.
It will save you headaches in the future.

leaden moss
#

If you always have it, return the primitive

#

or better yet, a custom type

primal edge
#

I am absolutely terrified of the ridiculous questions that will follow if you don't pick UUID

leaden moss
#

I made a custom mini cypher once, because we had limits on the length of the string we returned

#

And we only needed 40 bits