/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 filling in ByteToHexString() 46 hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); // get low four bits 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() 83 byte[i] = high << 4; // 4: Set the high nibble in HexStringToByte() 84 byte[i] |= low; // Set the low nibble in HexStringToByte()
|
/base/telephony/sms_mms/frameworks/native/mms/src/utils/ |
H A D | mms_quoted_printable.cpp | 36 for (auto byte : input) {
in Encode() 37 if ((byte >= asciiMin && byte < equalChar) || (byte > equalChar && byte <= assciiMax)) {
in Encode() 38 codeString += byte;
in Encode() 41 codeString += hex[((byte >> 0x04) & 0x0F)];
in Encode() 42 codeString += hex[(byte & 0x0F)];
in Encode()
|
/base/security/device_auth/common_lib/impl/src/ |
H A D | string_util.c | 35 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen)
in ByteToHexString() argument 37 if (byte == NULL || hexStr == NULL) {
in ByteToHexString() 46 hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); /* 4: shift right for filling */
in ByteToHexString() 47 hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); /* get low four bits */
in ByteToHexString() 67 int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen)
in HexStringToByte() argument 69 if (byte == NULL || hexStr == NULL) {
in HexStringToByte() 84 byte[i] = high << 4; /* 4: Set the high nibble */
in HexStringToByte() 85 byte[i] |= low; /* Set the low nibble */
in HexStringToByte()
|
H A D | json_utils.c | 234 int32_t GetByteFromJson(const CJson *jsonObj, const char *key, uint8_t *byte, uint32_t len)
in GetByteFromJson() argument 236 if (jsonObj == NULL || key == NULL || byte == NULL) {
in GetByteFromJson() 247 return HexStringToByte(valueStr, byte, len);
in GetByteFromJson() 442 int32_t AddByteToJson(CJson *jsonObj, const char *key, const uint8_t *byte, uint32_t len)
in AddByteToJson() argument 444 if (jsonObj == NULL || key == NULL || byte == NULL) {
in AddByteToJson() 453 int32_t ret = ByteToHexString(byte, len, hexStr, hexLen);
in AddByteToJson()
|
/base/security/device_security_level/baselib/utils/src/ |
H A D | utils_base64.c | 84 uint32_t byte = (((a << 16) & 0x00FF0000) | ((b << 8) & 0x0000FF00) | ((c << 0) & 0x000000FF)); /* 16, 8 */ in Base64Encode() local 86 to[j++] = g_base64EncodeTable[(byte >> 18) & 0x3F]; /* get the 1st block by shift 18 */ in Base64Encode() 87 to[j++] = g_base64EncodeTable[(byte >> 12) & 0x3F]; /* get the 2nd block by shift 12 */ in Base64Encode() 88 to[j++] = g_base64EncodeTable[(byte >> 6) & 0x3F]; /* get the 3rd block by shift 6 */ in Base64Encode() 89 to[j++] = g_base64EncodeTable[(byte >> 0) & 0x3F]; in Base64Encode() 144 uint32_t byte = in Base64Decode() local 148 to[j++] = (byte >> 16) & 0xFF; // 16, the 3rd 8-bit in Base64Decode() 151 to[j++] = (byte >> 8) & 0xFF; // 8, the 2nd 8-bit in Base64Decode() 154 to[j++] = (byte >> 0) & 0xFF; in Base64Decode()
|
/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);
|
/base/security/device_auth/common_lib/interfaces/ |
H A D | string_util.h | 38 * Convert hex string to byte.
40 * @param byte: the converted result, need malloc by caller
41 * @param byteLen: the length of byte, must be not shorter than strlen(hexStr) / 2
44 int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen);
47 * Convert byte to hex string.
48 * @param byte: byte to be converted
49 * @param byteLen: the length of byte
54 int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen);
|
H A D | json_utils.h | 80 * The byte in jsonObj must be in the form of hex string.
81 * This function will convert the hex string to byte, and then put it in param--byte in the form of byte.
83 int32_t GetByteFromJson(const CJson *jsonObj, const char *key, uint8_t *byte, uint32_t len);
94 /* The function will convert the byte to hex string, and then add it to object. */
95 int32_t AddByteToJson(CJson *jsonObj, const char *key, const uint8_t *byte, uint32_t len);
|
/base/security/device_auth/deps_adapter/key_management_adapter/impl/inc/ |
H A D | mbedtls_ec_adapter.h | 33 int32_t MbedtlsBase64Encode(const uint8_t *byte, uint32_t byteLen, char *base64Str, uint32_t strLen, uint32_t *outLen);
34 int32_t MbedtlsBase64Decode(const char *base64Str, uint32_t strLen, uint8_t *byte, uint32_t byteLen, uint32_t *outLen);
|
/base/telephony/core_service/utils/vcard/src/ |
H A D | vcard_raw_data.cpp | 23 void VCardRawData::SetByte(const std::string &byte) in SetByte() argument 25 bytes_ = byte; in SetByte()
|
/base/hiviewdfx/faultloggerd/interfaces/innerkits/unwinder/ |
H A D | dfx_memory.cpp | 213 uint8_t byte = 0; in ReadSleb128() local 215 if (!ReadU8(addr, &byte, true)) { in ReadSleb128() 219 val |= static_cast<uint64_t>(byte & 0x7f) << shift; in ReadSleb128() 221 } while (byte & 0x80); in ReadSleb128() 223 if ((byte & 0x40) != 0) { in ReadSleb128()
|
H A D | dfx_map.cpp | 359 size_t byte = DfxMemory::ReadProcMemByPid(pid, begin, shmmData->data(), size); in GetElf() local 360 if (byte != size) { in GetElf() 364 elf = std::make_shared<DfxElf>(shmmData->data(), byte); in GetElf()
|
/base/hiviewdfx/faultloggerd/interfaces/common/ |
H A D | byte_order.h | 53 #error Target has unknown byte ordering.
|
/base/telephony/sms_mms/frameworks/native/mms/include/ |
H A D | mms_encode_buffer.h | 27 bool WriteByte(uint8_t byte);
|
/base/telephony/sms_mms/utils/ |
H A D | string_utils.cpp | 93 std::string byte = str.substr(i, hexStep); in HexToString() local 95 long strTemp = strtol(byte.c_str(), nullptr, hexDecimal); in HexToString()
|
/base/security/device_auth/test/unittest/deviceauth/source/ |
H A D | json_utils_mock.c | 267 int32_t GetByteFromJson(const CJson *jsonObj, const char *key, uint8_t *byte, uint32_t len) in GetByteFromJson() argument 269 if (jsonObj == NULL || key == NULL || byte == NULL) { in GetByteFromJson() 280 return HexStringToByte(valueStr, byte, len); in GetByteFromJson() 475 int32_t AddByteToJson(CJson *jsonObj, const char *key, const uint8_t *byte, uint32_t len) in AddByteToJson() argument 477 if (jsonObj == NULL || key == NULL || byte == NULL) { in AddByteToJson() 486 int32_t ret = ByteToHexString(byte, len, hexStr, hexLen); in AddByteToJson()
|
/base/telephony/core_service/utils/vcard/include/ |
H A D | vcard_raw_data.h | 28 void SetByte(const std::string &byte);
|
H A D | vcard_contact.h | 88 void AddDatas(std::string name, std::string rawValue, std::string byte, std::vector<std::string> values, 127 void AddPhotoDatas(std::string byte, std::string rawValue, std::string propValue, std::vector<std::string> values, 137 void AddOtherDatas(std::string name, std::string rawValue, std::string byte, std::vector<std::string> values,
|
/base/hiviewdfx/hichecker/interfaces/js/kits/napi/js_leak_watcher/ |
H A D | js_leak_watcher.js | 89 return Array.from(digestOutPut.data, byte => ('0' + byte.toString(16)).slice(-2)).join('').toUpperCase();
|
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/ |
H A D | cert_manager_auth_mgr.c | 58 static int32_t ByteToHexString(const uint8_t *byte, uint32_t byteLen, char *hexStr, uint32_t hexLen) in ByteToHexString() argument 65 hexStr[i * BYTE_TO_HEX_OPER_LENGTH] = HexToChar((byte[i] & 0xF0) >> 4); /* 4: shift right for filling */ in ByteToHexString() 66 hexStr[i * BYTE_TO_HEX_OPER_LENGTH + 1] = HexToChar(byte[i] & 0x0F); /* get low four bits */ in ByteToHexString() 73 static int32_t HexStringToByte(const char *hexStr, uint8_t *byte, uint32_t byteLen) in HexStringToByte() argument 87 byte[i] = high << 4; /* 4: Set the high nibble */ in HexStringToByte() 88 byte[i] |= low; /* Set the low nibble */ in HexStringToByte() 283 CM_LOG_E("byte to hex string failed, ret = %d", ret); in ConstructAuthUri() 445 CM_LOG_E("malloc mac in byte failed"); in GetMacByteFromString() 451 CM_LOG_E("mac hex string to byte failed, ret = %d", ret); in GetMacByteFromString() 471 CM_LOG_E("get mac byte fro in CheckIsAuthorizedApp() [all...] |
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/common/ |
H A D | mbedtls_ec_adapter.c | 568 int32_t MbedtlsBase64Encode(const uint8_t *byte, uint32_t byteLen, char *base64Str, uint32_t strLen, uint32_t *outLen) in MbedtlsBase64Encode() argument 570 CHECK_PTR_RETURN_HAL_ERROR_CODE(byte, "byte"); in MbedtlsBase64Encode() 577 (void)mbedtls_base64_encode(NULL, 0, &needBuffLen, byte, byteLen); in MbedtlsBase64Encode() 584 int res = mbedtls_base64_encode((unsigned char *)base64Str, strLen, &needBuffLen, byte, byteLen); in MbedtlsBase64Encode() 594 int32_t MbedtlsBase64Decode(const char *base64Str, uint32_t strLen, uint8_t *byte, uint32_t byteLen, uint32_t *outLen) in MbedtlsBase64Decode() argument 598 CHECK_PTR_RETURN_HAL_ERROR_CODE(byte, "byte"); in MbedtlsBase64Decode() 615 res = mbedtls_base64_decode(byte, byteLen, &needBuffLen, (const unsigned char *)base64Str, strLen); in MbedtlsBase64Decode()
|
/base/location/services/location_gnss/gnss/source/ |
H A D | string_utils.cpp | 95 std::string byte = str.substr(i, hexStep); in HexToString() local 97 long strTemp = strtol(byte.c_str(), nullptr, hexDecimal); in HexToString()
|
/base/hiviewdfx/faultloggerd/tools/process_dump/ |
H A D | dfx_unwind_async_thread.cpp | 101 size_t byte = DfxMemory::ReadProcMemByPid(thread_->threadInfo_.nsTid, map->begin, tableData->data(), size); in GetSubmitterStack() local 102 if (byte != size) { in GetSubmitterStack()
|
/base/security/device_auth/deps_adapter/key_management_adapter/interfaces/ |
H A D | alg_defs.h | 146 typedef int32_t (*Base64EncodeFunc)(const uint8_t *byte, uint32_t byteLen, 150 uint8_t *byte, uint32_t byteLen, uint32_t *outLen);
|
/base/notification/distributed_notification_service/services/ans/src/common/ |
H A D | aes_gcm_helper.cpp | 48 for (const unsigned char byte : bytes) { in Byte2Hex() 49 oss << std::hex << std::setw(WIDTH_PER_BYTE) << std::setfill('0') << static_cast<int>(byte); in Byte2Hex()
|