Converting a string to Base64 in echelon

Im trying to convert a string (combination of mobile number and password) to a Base64 string. I seem to be running into a couple of issues (please excuse my ignorance, I am totally new to Python):

1. I have tried to import the following library (import base64), but I get an error saying "No module named base64".

2. I have read some conflicting info. Some say that (base64.b64encode) only works on byte arrays, while others are using it with a string. Do I need to convert my string to a byte array first, or will this work on a string.

3. Does anyone by chance have a snippet or a script showing how to do this.

2 Comments

IronPython is an implementation of the Python language, that targets the .NET framework. As a result, you won’t be able to use Python specific libraries, but should use the .NET classes/namespace. Below is an example of how to do this: