CryptoSys API  6.22.1
Static Public Member Functions | List of all members
crsysapi::Cnv Class Reference

Character conversion routines. More...

Static Public Member Functions

static bvec_t FromBase64 (const std::string &s)
 Decodes a base64-encoded string as an array of bytes. More...
 
static bvec_t FromHex (const std::string &s)
 Decodes a hexadecimal-encoded string as an array of bytes. More...
 
static std::string ShortPathName (const std::wstring &filePath)
 Retrieve the Windows short path form of the specified path. More...
 
static std::string ToBase64 (const bvec_t &bv)
 Encodes an array of bytes as a base64-encoded string. More...
 
static std::string ToBase64 (const std::string &s)
 Encodes a string as a base64-encoded string. More...
 
static std::string ToHex (const bvec_t &bv)
 Encodes an array of bytes as a hexadecimal-encoded string. More...
 
static std::string ToHex (const std::string &s)
 Encodes a string as a hexadecimal-encoded string. More...
 

Detailed Description

Character conversion routines.

Member Function Documentation

◆ FromBase64()

static bvec_t crsysapi::Cnv::FromBase64 ( const std::string &  s)
static

Decodes a base64-encoded string as an array of bytes.

Parameters
sBase64-encoded data to be decoded.
Returns
Array of bytes.

◆ FromHex()

static bvec_t crsysapi::Cnv::FromHex ( const std::string &  s)
static

Decodes a hexadecimal-encoded string as an array of bytes.

Parameters
sHexadecimal-encoded data to be decoded.
Returns
Array of bytes.

◆ ShortPathName()

static std::string crsysapi::Cnv::ShortPathName ( const std::wstring &  filePath)
static

Retrieve the Windows short path form of the specified path.

Parameters
filePathPath name in wide characters.
Returns
Windows short path name or empty string if file does not exist.
Remarks
Windows only. The file path must exist. The short path is guaranteed to be ASCII. It may not have the same value on a different system.

◆ ToBase64() [1/2]

static std::string crsysapi::Cnv::ToBase64 ( const bvec_t bv)
static

Encodes an array of bytes as a base64-encoded string.

Parameters
bvInput byte array.
Returns
Base64-encoded string.

◆ ToBase64() [2/2]

static std::string crsysapi::Cnv::ToBase64 ( const std::string &  s)
static

Encodes a string as a base64-encoded string.

Parameters
sString to be endoded.
Returns
Base64-encoded string.
cout << crsysapi::Cnv::ToBase64("abc") << endl;
// YWJj
static std::string ToBase64(const bvec_t &bv)
Encodes an array of bytes as a base64-encoded string.

◆ ToHex() [1/2]

static std::string crsysapi::Cnv::ToHex ( const bvec_t bv)
static

Encodes an array of bytes as a hexadecimal-encoded string.

Parameters
bvInput byte array.
Returns
Hexadecimal-encoded string.

◆ ToHex() [2/2]

static std::string crsysapi::Cnv::ToHex ( const std::string &  s)
static

Encodes a string as a hexadecimal-encoded string.

Parameters
sString to be endoded.
Returns
Hexadecimal-encoded string.
cout << crsysapi::Cnv::ToHex("abc") << endl;
// 616263
static std::string ToHex(const bvec_t &bv)
Encodes an array of bytes as a hexadecimal-encoded string.
Copyright © 2001-24 D.I. Management Services Pty Limited ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Sat Jan 6 2024 18:00:07 by Doxygen 1.9.1.