Class StringFactory
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Provides access to factory methods for creating encoded string representations.
public static class StringFactory
- Inheritance
-
StringFactory
Methods
CreateBinaryDigits(byte[])
Creates a binary digit string representation of the specified byte array.
public static string CreateBinaryDigits(byte[] value)
Parameters
valuebyte[]The byte array to convert.
Returns
- string
A binary digit string representation of
value.
Exceptions
- ArgumentNullException
valueis null.
CreateHexadecimal(byte[])
Creates a hexadecimal string representation of the specified byte array.
public static string CreateHexadecimal(byte[] value)
Parameters
valuebyte[]The byte array to convert.
Returns
- string
A hexadecimal string representation of
value.
Exceptions
- ArgumentNullException
valueis null.
CreateHexadecimal(string, Action<EncodingOptions>)
Creates a hexadecimal string representation of the specified string.
public static string CreateHexadecimal(string value, Action<EncodingOptions> setup = null)
Parameters
valuestringThe string to convert.
setupAction<EncodingOptions>The delegate that configures the encoding behavior.
Returns
- string
A hexadecimal string representation of
value.
Exceptions
- ArgumentNullException
valueis null.- InvalidEnumArgumentException
setupconfigures an invalid value for Preamble.
CreateProtocolRelativeUrl(Uri, Action<ProtocolRelativeUriStringOptions>)
Creates a protocol-relative URL string representation of the specified Uri.
public static string CreateProtocolRelativeUrl(Uri value, Action<ProtocolRelativeUriStringOptions> setup = null)
Parameters
valueUriThe URI to convert.
setupAction<ProtocolRelativeUriStringOptions>The delegate that configures the protocol-relative URL format.
Returns
- string
A protocol-relative URL string representation of
value.
Exceptions
- ArgumentNullException
valueis null.- ArgumentException
valueis not an absolute URI.
CreateUriScheme(UriScheme)
Creates the string representation of the specified UriScheme.
public static string CreateUriScheme(UriScheme value)
Parameters
valueUriSchemeThe URI scheme to convert.
Returns
- string
The string representation of
value.
Remarks
Returns the string representation of Undefined when value
is not found in the lookup table.
CreateUrlEncodedBase64(byte[])
Creates a URL-safe Base64 string representation of the specified byte array.
public static string CreateUrlEncodedBase64(byte[] value)
Parameters
valuebyte[]The byte array to convert.
Returns
- string
A URL-safe Base64 string representation of
value.
Remarks
This method uses the Base64 URL encoding convention by removing padding characters and replacing
+ with - and / with _.
The implementation was inspired by Appendix C of the JSON Web Signature (JWS) draft specification.
Exceptions
- ArgumentNullException
valueis null.