[The Utilities object is available for use in the operating systems specified in the Requirements section.]
The Utilities object provides functionality for random number generation, conversions, and encoding and decoding from base64.
When to use
The Utilities object is used to perform the following tasks:
- Encode a string as base64 or decode a string from base64.
- Convert a binary-packed string to a byte array and vice versa.
- Convert a binary-packed string to a hexadecimal string and vice versa.
- Generate a secure random number.
- Convert local time to Coordinated Universal Time (Greenwich Mean Time) and vice versa.
The Utilities object has these types of members:
The Utilities object has these methods.
|Base64Decode||Decodes a string from base64.
|Base64Encode||Encodes a string as base64.
|BinaryStringToByteArray||Converts a binary-packed string to an array of bytes.
|BinaryToHex||Converts a binary-packed string to a hexadecimal string.
|ByteArrayToBinaryString||Converts an array of bytes to a binary-packed string.
|GetRandom||Generates a secure random number.
|HexToBinary||Converts a hexadecimal string to a binary-packed string.
|LocalTimeToUTCTime||Converts the computer's local time to Coordinated Universal Time.
|UTCTimeToLocalTime||Converts Coordinated Universal Time to the computer's local time.
The Utilities object can be created, and it is safe for scripting. The ProgID for the Utilities object is CAPICOM.Utilities.1.
||CAPICOM 2.0 or later on Windows Server 2003 and Windows XP