Алексей Безбородов
1 year ago
commit
f2f3d0038f
5 changed files with 112 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||||
|
This is free and unencumbered software released into the public domain. |
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or |
||||||
|
distribute this software, either in source code form or as a compiled |
||||||
|
binary, for any purpose, commercial or non-commercial, and by any |
||||||
|
means. |
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors |
||||||
|
of this software dedicate any and all copyright interest in the |
||||||
|
software to the public domain. We make this dedication for the benefit |
||||||
|
of the public at large and to the detriment of our heirs and |
||||||
|
successors. We intend this dedication to be an overt act of |
||||||
|
relinquishment in perpetuity of all present and future rights to this |
||||||
|
software under copyright law. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
||||||
|
OTHER DEALINGS IN THE SOFTWARE. |
||||||
|
|
||||||
|
For more information, please refer to <https://unlicense.org> |
@ -0,0 +1,5 @@ |
|||||||
|
# Программа генерации случайного ключа |
||||||
|
|
||||||
|
* В программе можно выбрать на основе каких символов сгенерировать ключ (по умолчанию используется HEX символы) |
||||||
|
* Возможно выбрать длину генерируемого ключа |
||||||
|
* При каждом нажатии кнопки генерируется новый ключ |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,72 @@ |
|||||||
|
<!-- Copyright 2023 by Alexei Bezborodov <AlexeiBv+mirocod_wave_reflection@narod.ru> --> |
||||||
|
<!-- public domain --> |
||||||
|
|
||||||
|
<html lang="ru"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<title>Генерация ключа</title> |
||||||
|
|
||||||
|
<!-- |
||||||
|
Загрузка скриптов из интернета |
||||||
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/brython@3.8.9/brython.min.js"></script> |
||||||
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/brython@3.8.9/brython_stdlib.js"></script> |
||||||
|
--> |
||||||
|
|
||||||
|
<!-- |
||||||
|
Загрузка скриптов из локальной папки (рядом с файлом html) |
||||||
|
--> |
||||||
|
<script type="text/javascript" src="brython.min.js"></script> |
||||||
|
<script type="text/javascript" src="brython_stdlib.js"></script> |
||||||
|
|
||||||
|
|
||||||
|
</head> |
||||||
|
|
||||||
|
<body onload="brython()"> |
||||||
|
|
||||||
|
<h1 class="text-center">Генерация случайного ключа</h1> |
||||||
|
|
||||||
|
Символы для генерации ключа |
||||||
|
<input id = "words" value="0123456789ABCDEF"/> |
||||||
|
<br/> |
||||||
|
|
||||||
|
Размер ключа |
||||||
|
<select size="1" id="key_size"> |
||||||
|
<option>64</option> |
||||||
|
<option>128</option> |
||||||
|
<option selected="selected">256</option> |
||||||
|
<option>512</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<br/> |
||||||
|
|
||||||
|
<input type="button" id="gen_key" value="Сгенерировать ключ"></input> |
||||||
|
|
||||||
|
<p id="output"></p> |
||||||
|
|
||||||
|
<script type="text/python"> |
||||||
|
|
||||||
|
from browser import document, html, window |
||||||
|
import random, math |
||||||
|
|
||||||
|
def base_func(x, omega): |
||||||
|
return math.sin(x + omega) |
||||||
|
|
||||||
|
def gen_key(size): |
||||||
|
result = '' |
||||||
|
words = document["words"].value |
||||||
|
for i in range(size // 4): |
||||||
|
result += words[random.randint(0, len(words) - 1)] |
||||||
|
return result |
||||||
|
|
||||||
|
def gen_key_event(event): |
||||||
|
document["output"].innerHTML = gen_key(int(document["key_size"].value)) |
||||||
|
|
||||||
|
|
||||||
|
document["gen_key"].bind("click", gen_key_event) |
||||||
|
|
||||||
|
</script> |
||||||
|
|
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
Loading…
Reference in new issue