pkg-perl-maintainers team mailing list archive
-
pkg-perl-maintainers team
-
Mailing list archive
-
Message #04966
[Bug 2073269] Re: [MIR] libconvert-base32-perl and libcrypt-urandom-perl
We are having a small competition :)
a)
#!/usr/bin/env python3
import base64
import secrets
def generate_secret():
# Generate 12 random bytes
random_bytes = secrets.token_bytes(12)
# Convert to base32
base32_string = base64.b32encode(random_bytes).decode('utf-8').lower()
# Split into groups of 4 characters
grouped = [base32_string[i:i+4] for i in range(0, len(base32_string), 4)]
# Join with hyphens and print
print('-'.join(grouped))
if __name__ == "__main__":
generate_secret()
--
You received this bug notification because you are a member of Debian
Perl Group, which is subscribed to libconvert-base32-perl in Ubuntu.
https://bugs.launchpad.net/bugs/2073269
Title:
[MIR] libconvert-base32-perl and libcrypt-urandom-perl
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/freeradius/+bug/2073269/+subscriptions
References