This is my current code:
encodedstring = base64.encodestring(b"admin:password")[:-1]
Now i want to use variables for the username & password, something like this?
username = "admin"
password = "password"
user_pass = username + ":" + password
user_pass = b"user_pass <<<<?
encodedstring = base64.encodestring(user_pass)[:-1]
How can i do this?
Many Thanks
Well, like this?
Or are you saying that username and password comes from someplace which gives you strings?
In that case encode them.
Use UTF-8 so that non-ascii characters work as well.