/
githubmirror
/
nettle
Обзор
Документация
Войти
/
githubmirror
/
nettle
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
misc/umac/repeat.py
17 строк
314 B
Niels Möller
umac reference code, for generation of test vectors.
15 апр 2013, 18:02
15 апр 2013, 18:02
bf5649c
Код
Авторство
О чём код?
import sys if len(sys.argv) < 3: sys.stderr.write('Usage: repeat [string] [length]\n') sys.exit(1) s = sys.argv[1] length = int(sys.argv[2]) if length > 0: if length > 1024: while len(s) < 1024: s = s + s; while length > len(s): sys.stdout.write(s) length -= len(s) sys.stdout.write(s[:length])