I want to generate unique alphanumeric string of length 28 from two unique alphanumeric strings. Is it mathematically possible to have collision free string from two unique strings?
here is what I did,
ASCII_NUMBER_RANGE_START = 48;
ASCII_ALPHABET_RANGE_START =55;
for (int i = 0; i < firstArray.length; i++) {
int tempASCIIValue = (Character.getNumericValue(firstArray[i]) + Character.getNumericValue(secondArray[i])) % 35;
if (tempASCIIValue <= 9) {
FINAL_ASCII_VALUE = tempASCIIValue + ASCII_NUMBER_RANGE_START;
} else {
FINAL_ASCII_VALUE = tempASCIIValue + ASCII_ALPHABET_RANGE_START;
}
combinedArray[i] = (char) FINAL_ASCII_VALUE;
}
return new String(combinedArray);
}
In above code, i am not sure whether the resultant string is as uniquely strong as its parent strings.
Note: the generated string to have same length as the parent string
Any help is appreciated. Thanks.