I have really struggled to find the javascript equivalents to this C# code.
string authInfo = userName + ":" + userPassword;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
return "Basic " + authInfo;
Can any one help with this basic base64 encoding?