BrowserStringUtils class
Utility functions for strings in a browser. See here for implementation details: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
Methods
get |
Returns stringified jwk. |
string |
Converst string to ArrayBuffer |
string |
Converts string to Uint8Array |
utf8Arr |
Converts Uint8Array to a string |
Method Details
getSortedObjectString(object)
Returns stringified jwk.
static function getSortedObjectString(obj: object): string
Parameters
- obj
-
object
Returns
string
stringToArrayBuffer(string)
Converst string to ArrayBuffer
static function stringToArrayBuffer(dataString: string): ArrayBuffer
Parameters
- dataString
-
string
Returns
ArrayBuffer
stringToUtf8Arr(string)
Converts string to Uint8Array
static function stringToUtf8Arr(sDOMStr: string): Uint8Array
Parameters
- sDOMStr
-
string
Returns
Uint8Array
utf8ArrToString(Uint8Array)
Converts Uint8Array to a string
static function utf8ArrToString(aBytes: Uint8Array): string
Parameters
- aBytes
-
Uint8Array
Returns
string