A set of string utility functions.
- Source:
Methods
-
(static) formatHexString(str) → {string}
-
Separates every 4 characters by a space.
Parameters:
Name Type Description str
string - Source:
Returns:
- Type
- string
-
(static) fromBase64(str) → {string}
-
Convert a base64 string to a raw string. Accepts either the standard alphabet or the alternate "base64url" alphabet.
Parameters:
Name Type Description str
string - Source:
Returns:
- Type
- string
-
(static) toBase64(str, opt_paddingopt) → {string}
-
Convert a raw string to a base64 string. The output will always use the alternate encoding/alphabet also known as "base64url".
Parameters:
Name Type Attributes Description str
string opt_padding
boolean <optional>
If true, pad the output with equals signs. Defaults to true. - Source:
Returns:
- Type
- string