#Creating unique string from two integers.

1 messages · Page 1 of 1 (latest)

livid osprey
#

Hey guys!

I'm trying to turn 2 integers (specifically x and z coordinates) into a unique and random string (preferably a fixed character length every time) which I can also get the original 2 integers from if I want to.

I've tried to figure this out on my own but didn't get very far 😅

Any ideas/suggestions are appreciated!

steel merlin
#

what if you have the same x and z again?

livid osprey
#

Just realized I'm gonna need to use 3 integers, for x y and z :P

crude lodge
#

not sure, but it sounds like you could have the first x and z coords as variables

livid osprey
#

as long as the x and z are the same it should produce the same string

livid osprey
crude lodge
#

the original variables

steel merlin
#

why tho

livid osprey
#

ye I need a unique string for each x, y, and z combination. If the same x, y, and z pops up it should create the exact same string result

livid osprey
#

as short as possible

steel merlin
#

then just do "{x}|{y}|{z}"

livid osprey
#

yes..... but I'm sure there must be a shorter and more elegant solution 😄

steel merlin
#

whats not short and elegant about this?