]>
git.scottworley.com Git - rfc1751/blob - rfc1751.py
3 from rfc1751wordlist
import WORD_LIST
, WORD_LIST_SIZE
9 def encode(x
: int) -> str:
13 def rfc1751_actual(x
: int) -> list[str]:
14 return [] if x
<= 0 else rfc1751_actual(
15 x
// WORD_LIST_SIZE
) + [encode(x
% WORD_LIST_SIZE
)]
18 def rfc1751(x
: int) -> list[str]:
19 return [WORD_LIST
[x
]] if x
== 0 else rfc1751_actual(x
)
23 print(' '.join(rfc1751(int(sys
.argv
[1]))))
26 if __name__
== '__main__':