C# Class Novell.Directory.Ldap.Utilclass.Base64

The Base64 utility class performs base64 encoding and decoding. The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the unencoded data. The base64 encoding algorithm is defined by RFC 2045.
Afficher le fichier Open project: EventStore/csharp-ldap

Méthodes publiques

Méthode Description
encode ( System inputString ) : System.String

Encodes the specified String into a base64 encoded String object.

isLDIFSafe ( System str ) : bool

Checks if the input String contains only safe values, that is, the data does not need to be encoded for use with LDIF. The rules for checking safety are based on the rules for LDIF (Ldap Data Interchange Format) per RFC 2849. The data does not need to be encoded if all the following are true: The data cannot start with the following char values:

 00 (NUL) 10 (LF) 13 (CR) 32 (SPACE) 58 (:) 60 (LESSTHAN) Any character with value greater than 127 
The data cannot contain any of the following char values:
 00 (NUL) 10 (LF) 13 (CR) Any character with value greater than 127 
The data cannot end with a space.

Private Methods

Méthode Description
Base64 ( ) : System

Default constructor, don't allow instances of the utility class to be created.

decode ( System encodedString ) : sbyte[]
decode ( System encodedSBuf, int start, int end ) : sbyte[]
decode ( char encodedChars ) : sbyte[]
encode ( sbyte inputBytes ) : System.String
getByteCount ( sbyte b ) : int

Given the first byte in a sequence, getByteCount returns the number of additional bytes in a UTF-8 character sequence (not including the first byte).

isLDIFSafe ( sbyte bytes ) : bool
isValidUTF8 ( sbyte array, bool isUCS2Only ) : bool

Method Details

encode() public static méthode

Encodes the specified String into a base64 encoded String object.
public static encode ( System inputString ) : System.String
inputString System The String object to be encoded. /// ///
Résultat System.String

isLDIFSafe() public static méthode

Checks if the input String contains only safe values, that is, the data does not need to be encoded for use with LDIF. The rules for checking safety are based on the rules for LDIF (Ldap Data Interchange Format) per RFC 2849. The data does not need to be encoded if all the following are true: The data cannot start with the following char values:
 00 (NUL) 10 (LF) 13 (CR) 32 (SPACE) 58 (:) 60 (LESSTHAN) Any character with value greater than 127 
The data cannot contain any of the following char values:
 00 (NUL) 10 (LF) 13 (CR) Any character with value greater than 127 
The data cannot end with a space.
public static isLDIFSafe ( System str ) : bool
str System the String to be checked. /// ///
Résultat bool