/ohos5.0/base/security/dlp_permission_service/frameworks/common/src/ |
H A D | hex_string.cpp | 31 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() 45 …hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); // 4: shift right for fil… 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() 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 D | string_util.c | 34 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() 45 …hexStr[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 D | json_utils.c | 449 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 D | pake_v1_protocol_task_common.c | 492 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 D | dm_radar_helper.cpp | 147 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 D | icc_operator_rule.cpp | 92 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 D | hex_string.h | 25 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 D | string_util.h | 38 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 D | bluetooth_mock.cpp | 294 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 D | bluetooth_mock.h | 125 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 D | json_utils_mock.c | 482 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 D | setaccesslimit_fuzzer.cpp | 37 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 D | medialibrary_common_utils.cpp | 62 …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 D | cert_manager_auth_mgr.c | 57 static int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen) in ByteToHexString() argument 64 …hexStr[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 D | hril_base.cpp | 75 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 D | dentry_meta_file_test.cpp | 358 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 D | wifi_global_func.h | 163 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 D | medialibrary_common_utils_test.cpp | 81 string hexStr = ""; variable 82 MediaLibraryCommonUtils::Char2Hex(hash, len, hexStr); 83 EXPECT_NE(hexStr, "");
|
/ohos5.0/base/hiviewdfx/hilog/test/unittest/common/ |
H A D | hilog_utils_test.cpp | 193 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 D | icc_operator_rule.h | 44 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 D | converter.cpp | 303 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 D | avsession_radar.cpp | 84 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 D | medialibrary_common_utils.h | 37 static void Char2Hex(const unsigned char *data, const size_t len, std::string &hexStr);
|
/ohos5.0/foundation/distributedhardware/device_manager/radar/src/ |
H A D | dm_radar_helper.cpp | 776 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 D | meta_file.cpp | 692 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()
|