import base64
encoded = base64.b64encode('user:pass'.encode('UTF-8')).decode('ASCII')
print(encoded)

efedb945c1bd268018b159b79847f4a1d06e161b
<mask token>

<mask token>
print(encoded)

<mask token>
encoded = base64.b64encode('user:pass'.encode('UTF-8')).decode('ASCII')
print(encoded)

import base64
encoded = base64.b64encode('user:pass'.encode('UTF-8')).decode('ASCII')
print(encoded)
