Home
last modified time | relevance | path

Searched refs:hexStr (Results 1 – 25 of 36) sorted by relevance

12

/ohos5.0/base/security/dlp_permission_service/frameworks/common/src/
H A Dhex_string.cpp31 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen) in ByteToHexString() argument
33 if (byte == nullptr || hexStr == nullptr) { in ByteToHexString()
45hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); // 4: shift right for fil… in ByteToHexString()
46hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); // get low four bits in ByteToHexString()
48 hexStr[byteLen * BYTE_TO_HEX_OPER_LENGTH] = '\0'; in ByteToHexString()
67 int32_t HexStringToByte(const char *hexStr, uint32_t hexStrLen, uint8_t *byte, uint32_t byteLen) in HexStringToByte() argument
69 if (byte == nullptr || hexStr == nullptr || hexStrLen == 0) { in HexStringToByte()
78 uint8_t high = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH]); in HexStringToByte()
79 uint8_t low = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1]); in HexStringToByte()
/ohos5.0/base/security/device_auth/common_lib/impl/src/
H A Dstring_util.c34 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen) in ByteToHexString() argument
36 if (byte == NULL || hexStr == NULL) { in ByteToHexString()
45hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); /* 4: shift right for fill… in ByteToHexString()
46 hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); /* get low four bits */ in ByteToHexString()
48 hexStr[byteLen * BYTE_TO_HEX_OPER_LENGTH] = '\0'; in ByteToHexString()
66 int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen) in HexStringToByte() argument
68 if (byte == NULL || hexStr == NULL) { in HexStringToByte()
71 uint32_t realHexLen = HcStrlen(hexStr); in HexStringToByte()
78 uint8_t high = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH]); in HexStringToByte()
79 uint8_t low = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1]); in HexStringToByte()
H A Djson_utils.c449 char *hexStr = (char *)HcMalloc(hexLen, 0); in AddByteToJson() local
450 if (hexStr == NULL) { in AddByteToJson()
453 int32_t ret = ByteToHexString(byte, len, hexStr, hexLen); in AddByteToJson()
455 HcFree(hexStr); in AddByteToJson()
459 ret = AddStringToJson(jsonObj, key, hexStr); in AddByteToJson()
461 HcFree(hexStr); in AddByteToJson()
465 HcFree(hexStr); in AddByteToJson()
/ohos5.0/base/security/device_auth/services/legacy/authenticators/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/
H A Dpake_v1_protocol_task_common.c492 if (hexStr == NULL) { in AddPseudonymIdToPayload()
499 HcFree(hexStr); in AddPseudonymIdToPayload()
503 .val = (uint8_t *)hexStr, in AddPseudonymIdToPayload()
509 HcFree(hexStr); in AddPseudonymIdToPayload()
514 HcFree(hexStr); in AddPseudonymIdToPayload()
517 HcFree(hexStr); in AddPseudonymIdToPayload()
525 if (hexStr == NULL) { in AddPseudonymChallengeToPayload()
532 HcFree(hexStr); in AddPseudonymChallengeToPayload()
542 HcFree(hexStr); in AddPseudonymChallengeToPayload()
547 HcFree(hexStr); in AddPseudonymChallengeToPayload()
[all …]
/ohos5.0/foundation/distributedhardware/device_manager/radar/src/lite/
H A Ddm_radar_helper.cpp147 std::string hexStr = str.str(); in ConvertHexToString() local
148 transform(hexStr.begin(), hexStr.end(), hexStr.begin(), ::toupper); in ConvertHexToString()
149 return hexStr; in ConvertHexToString()
/ohos5.0/base/telephony/core_service/services/sim/src/
H A Dicc_operator_rule.cpp92 bool IccOperatorRule::CreateFromTLV(const std::string &hexStr, std::vector<IccOperatorRule> &result) in CreateFromTLV() argument
95 return CreateFromTLV(hexStr.begin(), hexStr.end(), result); in CreateFromTLV()
264 bool IccOperatorRule::SetPackageNameByHexStr(const std::string &hexStr) in SetPackageNameByHexStr() argument
267 auto it = hexStr.begin(); in SetPackageNameByHexStr()
268 while (it != hexStr.end()) { in SetPackageNameByHexStr()
270 if (!readOneByte(it, hexStr.end(), value)) { in SetPackageNameByHexStr()
/ohos5.0/base/security/dlp_permission_service/frameworks/common/include/
H A Dhex_string.h25 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen);
26 int32_t HexStringToByte(const char *hexStr, uint32_t hexStrLen, uint8_t *byte, uint32_t byteLen);
/ohos5.0/base/security/device_auth/common_lib/interfaces/
H A Dstring_util.h38 int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen);
48 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen);
/ohos5.0/foundation/communication/dsoftbus/tests/core/discovery/ble/bluetooth_mock/
H A Dbluetooth_mock.cpp294 bool HexStr2Bytes(const std::string &hexStr, std::vector<uint8_t> &bytes) in HexStr2Bytes() argument
299 int32_t hexLen = hexStr.length(); in HexStr2Bytes()
304 bool isValid = std::all_of(hexStr.begin(), hexStr.end(), [](char chr) { in HexStr2Bytes()
316 const auto &subHexStr = hexStr.substr(index * HEX_CHAR_LEN, HEX_CHAR_LEN); in HexStr2Bytes()
322 void BluetoothMock::CallbackScanResult(const std::string &hexStr) in CallbackScanResult() argument
325 if (!HexStr2Bytes(hexStr, advData)) { in CallbackScanResult()
H A Dbluetooth_mock.h125 static void CallbackScanResult(const std::string &hexStr);
193 bool HexStr2Bytes(const std::string &hexStr, std::vector<uint8_t> &bytes);
/ohos5.0/base/security/device_auth/test/unittest/deviceauth/source/
H A Djson_utils_mock.c482 char *hexStr = (char *)HcMalloc(hexLen, 0); in AddByteToJson() local
483 if (hexStr == NULL) { in AddByteToJson()
486 int32_t ret = ByteToHexString(byte, len, hexStr, hexLen); in AddByteToJson()
488 HcFree(hexStr); in AddByteToJson()
492 ret = AddStringToJson(jsonObj, key, hexStr); in AddByteToJson()
494 HcFree(hexStr); in AddByteToJson()
498 HcFree(hexStr); in AddByteToJson()
/ohos5.0/base/telephony/core_service/test/fuzztest/setaccesslimit_fuzzer/
H A Dsetaccesslimit_fuzzer.cpp37 std::string hexStr(reinterpret_cast<const char *>(data), size); in DoSomethingInterestingWithMyAPI()
42 iccOperatorRule->SetPackageNameByHexStr(hexStr); in DoSomethingInterestingWithMyAPI()
/ohos5.0/foundation/multimedia/media_library/frameworks/utils/src/
H A Dmedialibrary_common_utils.cpp62 …MediaLibraryCommonUtils::Char2Hex(const unsigned char *data, const size_t len, std::string &hexStr) in Char2Hex() argument
67 hexStr = ""; in Char2Hex()
68 hexStr.reserve(OUT_HEXSTR_SIZE); in Char2Hex()
70 hexStr.append(CHAR2HEX_TABLE[data[i]]); in Char2Hex()
/ohos5.0/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
H A Dcert_manager_auth_mgr.c57 static int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen) in ByteToHexString() argument
64hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); /* 4: shift right for fill… in ByteToHexString()
65 hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); /* get low four bits */ in ByteToHexString()
67 hexStr[byteLen * BYTE_TO_HEX_OPER_LENGTH] = '\0'; in ByteToHexString()
72 static int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen) in HexStringToByte() argument
74 uint32_t realHexLen = strlen(hexStr); in HexStringToByte()
81 uint8_t high = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH]); in HexStringToByte()
82 uint8_t low = CharToHex(hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1]); in HexStringToByte()
/ohos5.0/base/telephony/ril_adapter/services/hril/src/
H A Dhril_base.cpp75 uint8_t *hexStr = (uint8_t *)response; in ConvertHexStringToBytes() local
78 uint8_t hexCh1 = ConvertHexCharToInt(hexStr[i]); in ConvertHexStringToBytes()
79 uint8_t hexCh2 = ConvertHexCharToInt(hexStr[i + 1]); in ConvertHexStringToBytes()
/ohos5.0/foundation/filemanagement/dfs_service/test/unittests/cloudsync_sa/dentry/
H A Ddentry_meta_file_test.cpp358 std::string hexStr = ""; variable
359 string ret = MetaFileMgr::GetInstance().RecordIdToCloudId(hexStr);
379 std::string hexStr = "test"; variable
380 string ret = MetaFileMgr::GetInstance().RecordIdToCloudId(hexStr);
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/utils/
H A Dwifi_global_func.h163 const std::string hexStr = "0123456789ABCDEF"; in Val2HexChar() local
168 pHexChar[pos] = hexStr[(tmp >> highBit) & 0x0F]; in Val2HexChar()
170 pHexChar[pos] = hexStr[tmp & 0x0F]; in Val2HexChar()
/ohos5.0/foundation/multimedia/media_library/frameworks/innerkitsimpl/test/unittest/medialibrary_common_utils_test/src/
H A Dmedialibrary_common_utils_test.cpp81 string hexStr = ""; variable
82 MediaLibraryCommonUtils::Char2Hex(hash, len, hexStr);
83 EXPECT_NE(hexStr, "");
/ohos5.0/base/hiviewdfx/hilog/test/unittest/common/
H A Dhilog_utils_test.cpp193 std::string hexStr = "d002d00"; variable
196 EXPECT_EQ(Uint2HexStr(hexNum), hexStr);
197 EXPECT_EQ(HexStr2Uint(hexStr), hexNum);
/ohos5.0/base/telephony/core_service/services/sim/include/
H A Dicc_operator_rule.h44 static bool CreateFromTLV(const std::string &hexStr, std::vector<IccOperatorRule> &result);
55 bool SetPackageNameByHexStr(const std::string &hexStr);
/ohos5.0/commonlibrary/ets_utils/js_api_module/buffer/
H A Dconverter.cpp303 string HexDecode(const string &hexStr) in HexDecode() argument
306 unsigned int arrSize = hexStr.size(); in HexDecode()
313 hexStrTmp.push_back(hexStr[i * 2]); in HexDecode()
315 hexStrTmp.push_back(hexStr[i * 2 + 1]); in HexDecode()
/ohos5.0/foundation/multimedia/av_session/utils/src/
H A Davsession_radar.cpp84 std::string hexStr = str.str(); in ConvertHexToString() local
85 transform(hexStr.begin(), hexStr.end(), hexStr.begin(), ::toupper); in ConvertHexToString()
86 return hexStr; in ConvertHexToString()
/ohos5.0/foundation/multimedia/media_library/frameworks/utils/include/
H A Dmedialibrary_common_utils.h37 static void Char2Hex(const unsigned char *data, const size_t len, std::string &hexStr);
/ohos5.0/foundation/distributedhardware/device_manager/radar/src/
H A Ddm_radar_helper.cpp776 std::string hexStr = str.str(); in ConvertHexToString() local
777 transform(hexStr.begin(), hexStr.end(), hexStr.begin(), ::toupper); in ConvertHexToString()
778 return hexStr; in ConvertHexToString()
/ohos5.0/foundation/filemanagement/dfs_service/utils/dentry/src/
H A Dmeta_file.cpp692 std::string MetaFileMgr::RecordIdToCloudId(const std::string hexStr) in RecordIdToCloudId() argument
697 for (std::size_t i = 0; i < hexStr.length(); i += offset) { in RecordIdToCloudId()
698 std::string hexByte = hexStr.substr(i, offset); in RecordIdToCloudId()
703 LOGE("Invalid hexadecimal string: %{public}s", hexStr.c_str()); in RecordIdToCloudId()

12