Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

7

In general, placing constraints on your passwords, such as that they have x-many numerals and y-many letters, makes your password generation scheme slightly worse; there's no advantage. But sometimes we're required to do silly things. In this situation, it looks like the requirement is to have at least four of each, but that could change, as could the ...


7

Your passwords will be biased, with more letters appearing towards the front of the password and more digits towards the end. A better approach would be to determine how many digits you will have in the password. Then, for each character, determine if it should be a digit based on the number of digits you want to have and the number of characters left to ...


2

public static ulong GreatestCommonDivisor(ulong x, ulong y) { if (x == 0) { return y; } if (y == 0) { return x; } var g = ((int)CountTrailingZeros(x | y)); x >>= ((int)CountTrailingZeros(x)); do { y >>= ((int)CountTrailingZeros(y)); if (x > y) { var z = x; ...


Top 50 recent answers are included