SELECT '2017-01-01' + INTERVAL `d`.`dayOfYear` DAY + INTERVAL `h`.`hour` HOUR
FROM (
SELECT (`c`.`num`*100+`d`.`num`*10+`s`.`num`) AS `dayOfYear`
FROM (
SELECT 0 AS `num`
UNION SELECT 1
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
UNION SELECT 6
UNION SELECT 7
UNION SELECT 8
UNION SELECT 9
) AS `s`
JOIN (
SELECT 0 AS `num`
UNION SELECT 1
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
UNION SELECT 6
UNION SELECT 7
UNION SELECT 8
UNION SELECT 9
) AS `d` ON TRUE
JOIN (
SELECT 0 AS `num`
UNION SELECT 1
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
UNION SELECT 6
UNION SELECT 7
UNION SELECT 8
UNION SELECT 9
) AS `c` ON TRUE
HAVING `dayOfYear` < DAYOFYEAR('2017-12-31')
) AS `d`
JOIN (
SELECT 0 AS `hour`
UNION SELECT 1
UNION SELECT 2
UNION SELECT 3
UNION SELECT 4
UNION SELECT 5
UNION SELECT 6
UNION SELECT 7
UNION SELECT 8
UNION SELECT 9
UNION SELECT 10
UNION SELECT 11
UNION SELECT 12
UNION SELECT 13
UNION SELECT 14
UNION SELECT 15
UNION SELECT 16
UNION SELECT 17
UNION SELECT 18
UNION SELECT 19
UNION SELECT 20
UNION SELECT 21
UNION SELECT 22
UNION SELECT 23
) AS `h` ON TRUE
отправляет ключ для расшифровки зашифрованного текста по протоколу (или алгоритму) Диффи-Хеллмана
a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (d1 = 1; d1 <= 9; d1++) {
a[d1]++;
for (d2 = 0; d2 <= 9; d2++) {
a[d2]++;
for (d3 = d1; d3 <=9; d3++) {
a[d3]++;
for (d4 = (0 == d2 ? 1 : (d1 == d3 ? d2 : 0)); d4 <= 9; d4++) {
a[d4]++;
val1 = d1*10+d2;
val2 = d3*10+d4;
val = val1*val2;
b = [a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]];
b[val%10]--;
b[Math.floor(val/10)%10]--;
b[Math.floor(val/100)%10]--;
b[Math.floor(val/1000)]--;
diff = 0;
for (i = 0; i < 9; i++)
diff |= b[i];
if (0 == diff)
console.log(val1, val2, val);
a[d4]--;
}
a[d3]--;
}
a[d2]--;
}
a[d1]--;
}