I want to implement a String comparison function that doesn\'t take a different amount of time depending on the number of characters that match or the position
You can do constant time string comparisons if you intern your strings. Then you can compare them with == operator resulting in a constant time equality check.