trunk/src/LythumOSL.Security/Base64.cs
/// <summary>
/// Encoding binary bytes to BASE64 with url safe option
/// </summary>
/// <param name="data">Binary data</param>
/// <param name="urlSafe">True if to convert to url safe BASE64 string. WARNING! Url safe mode is incompatible with regular BASE64 encoded string format.</param>
/// <returns></returns>
Encoding binary bytes to BASE64 with url safe option
Encoding binary bytes to BASE64 with url safe option
public static string Encode (byte[] data, bool urlSafe)
		{
			if (urlSafe)
			{
				return Convert.ToBase64String (data).Replace ("+", "-").Replace ("/", "_");
			}
			else
			{
				return Convert.ToBase64String (data);
			}
		}
public static string Encode ( byte [ ] data , bool urlSafe ) { if ( urlSafe ) { return Convert . ToBase64String ( data ) . Replace ( " " , " " ) . Replace ( " " , " " ) ; } else { return Convert . ToBase64String ( data ) ; } }
Encoding binary bytes to BASE64 with url safe option
Encoding binary bytes to BASE64 with url safe option
None
data
byte[]
None
urlSafe
bool
True if to convert to url safe BASE64 string. WARNING. Url safe mode is incompatible with regular BASE64 encoded string format.
True if to convert to url safe BASE64 string . WARNING . Url safe mode is incompatible with regular BASE64 encoded string format .