mirror of
https://github.com/progval/irctest.git
synced 2025-04-07 07:49:52 +00:00
16 lines
371 B
Python
16 lines
371 B
Python
import base64
|
|
|
|
|
|
def sasl_plain_blob(username: str, passphrase: str) -> str:
|
|
blob = base64.b64encode(
|
|
b"\x00".join(
|
|
(
|
|
username.encode("utf-8"),
|
|
username.encode("utf-8"),
|
|
passphrase.encode("utf-8"),
|
|
)
|
|
)
|
|
)
|
|
blobstr = blob.decode("ascii")
|
|
return f"AUTHENTICATE {blobstr}"
|