/ohos5.0/foundation/graphic/graphic_3d/lume/LumeBase/api/base/util/ |
H A D | hash.h | 31 uint64_t hash(const T& value); 61 inline uint64_t hash(const int8_t& value) in hash() function 81 inline uint64_t hash(void* const& value) in hash() function 86 inline uint64_t hash(T* const& value) in hash() function 96 hash ^= *data; in FNV1a32Hash() 97 hash *= FNV_PRIME_32; in FNV1a32Hash() 100 return hash; in FNV1a32Hash() 118 uint64_t hash = FNV_OFFSET_BASIS; in FNV1aHash() local 120 hash ^= *data; in FNV1aHash() 121 hash *= FNV_PRIME; in FNV1aHash() [all …]
|
H A D | compile_time_hashes.h | 45 inline constexpr uint64_t FNV1aHash(const char* const first, uint64_t hash = FNV_OFFSET_BASIS) in BASE_BEGIN_NAMESPACE() 48 return hash; in BASE_BEGIN_NAMESPACE() 50 hash ^= (uint64_t)*first; in BASE_BEGIN_NAMESPACE() 52 hash = mulu64(hash, FNV_PRIME); in BASE_BEGIN_NAMESPACE() 53 return FNV1aHash(first + 1, hash); in BASE_BEGIN_NAMESPACE()
|
/ohos5.0/foundation/communication/dsoftbus/components/nstackx/fillp/src/fillp_lib/src/ |
H A D | sha256.c | 117 FILLP_UINT32 hash[FILLP_HASH_ARRAY_SZ]; in FillpSha256Compile() local 119 FillpErrorType err = memcpy_s(hash, sizeof(hash), ctx->hash, sizeof(ctx->hash)); in FillpSha256Compile() 138 hash[key0] += buf[key3]; in FillpSha256Compile() 141 hash[key0] += g_k256[key1]; in FillpSha256Compile() 144 hash[key0] += FILLP_S_1(hash[key1]); in FillpSha256Compile() 148 hash[key0] += FILLP_CH(hash[key1], hash[key2], hash[key3]); in FillpSha256Compile() 151 hash[key1] += hash[key0]; in FillpSha256Compile() 154 hash[key0] += FILLP_S_0(hash[key1]); in FillpSha256Compile() 158 hash[key0] += FILLP_MAJ(hash[key1], hash[key2], hash[key3]); in FillpSha256Compile() 164 ctx->hash[jdex] += hash[jdex]; in FillpSha256Compile() [all …]
|
/ohos5.0/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/ |
H A D | hash.cpp | 21 uint64_t hash = 0; in HashFunc() local 25 hash = (hash * PRIME_SEED) + input.at(idx); in HashFunc() 28 return hash; in HashFunc() 33 uint32_t hash = 0; in Hash32Func() local 37 hash = (hash << 4) + input.at(idx); // left shift the lowest 4 bits for 4 bits. in Hash32Func() 38 uint32_t x = (hash & 0xf0000000); in Hash32Func() 40 hash ^= (x >> 24); // right shift the high byte for 24 bits. in Hash32Func() 42 hash &= ~x; in Hash32Func() 44 return (hash & 0x7fffffff); in Hash32Func()
|
/ohos5.0/foundation/multimedia/image_framework/frameworks/innerkitsimpl/converter/include/ |
H A D | post_proc_slr.h | 46 uint32_t hash = 0; in HashKey() local 47 hash = mix(hash, SkGoodHash()(relax(src_.width))); in HashKey() 48 hash = mix(hash, SkGoodHash()(relax(src_.height))); in HashKey() 49 hash = mix(hash, SkGoodHash()(relax(dst_.width))); in HashKey() 50 hash = mix(hash, SkGoodHash()(relax(dst_.height))); in HashKey() 51 return hash; in HashKey() 54 uint32_t mix(uint32_t hash, uint32_t data) in mix() argument 56 hash += data; in mix() 57 hash += (hash << 10); // 10 hash value in mix() 58 hash ^= (hash >> 6); // 6 hash value in mix() [all …]
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-core-file-kit/ |
H A D | js-apis-file-hash.md | 1 # @ohos.file.hash (文件哈希处理) 12 import { hash } from '@kit.CoreFileKit'; 33 ## hash.hash 70 hash.hash(filePath, "sha256").then((str: string) => { 77 ## hash.hash 109 hash.hash(filePath, "sha256", (err: BusinessError, str: string) => { 117 ## hash.createHash<sup>12+</sup> 152 const hs = hash.createHash('sha256'); 159 const fileHash = await hash.hash(filePath, 'sha256'); 186 const hs = hash.createHash('sha256'); [all …]
|
/ohos5.0/base/hiviewdfx/hiview/utility/common_utils/ |
H A D | calc_fingerprint.cpp | 31 if (hash == nullptr || outHash == nullptr) { in ConvertToString() 39 int err = snprintf_s(outHash, charsEachHex + 1, charsEachHex, "%02x", hash[i]); in ConvertToString() 59 int CalcFingerprint::CalcFileSha(const string& filePath, char *hash, size_t len) in CalcFileSha() argument 61 if (filePath.empty() || hash == nullptr || !FileUtil::IsLegalPath(filePath)) { in CalcFileSha() 71 return ConvertToString(value, hash, len); in CalcFileSha() 74 int CalcFingerprint::CalcFileShaOriginal(const string& filePath, unsigned char *hash, size_t len) in CalcFileShaOriginal() argument 76 if (filePath.empty() || hash == nullptr || !FileUtil::IsLegalPath(filePath)) { in CalcFileShaOriginal() 104 SHA256_Final(hash, &ctx); in CalcFileShaOriginal() 123 return CalcBufferSha((unsigned char *)buffer.c_str(), bufSize, hash, len); in CalcBufferSha() 140 if (source == nullptr || hash == nullptr || sourceLen == 0) { in CalcBufferSha() [all …]
|
/ohos5.0/docs/en/application-dev/reference/apis-core-file-kit/ |
H A D | js-apis-file-hash.md | 1 # @ohos.file.hash (File Hash Processing) 12 import { hash } from '@kit.CoreFileKit'; 33 ## hash.hash 70 hash.hash(filePath, "sha256").then((str: string) => { 77 ## hash.hash 109 hash.hash(filePath, "sha256", (err: BusinessError, str: string) => { 117 ## hash.createHash<sup>12+</sup> 151 // Create a hash stream. 159 const fileHash = await hash.hash(filePath, 'sha256'); 185 // Create a hash stream. [all …]
|
/ohos5.0/drivers/hdf_core/framework/utils/src/ |
H A D | hdf_map.c | 20 uint32_t hash; member 107 node->hash = hash; in MapCreateNode() 139 uint32_t hash; in MapSet() local 145 hash = MapHash(key); in MapSet() 150 if (node->hash != hash || node->key == NULL || strcmp(node->key, key) != 0) { in MapSet() 193 uint32_t hash; in MapGet() local 201 hash = MapHash(key); in MapGet() 206 if (node->hash == hash && node->key != NULL && !strcmp(node->key, key)) { in MapGet() 218 uint32_t hash; in MapErase() local 227 hash = MapHash(key); in MapErase() [all …]
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/src/core/modules/presets/ |
H A D | cjson_parser.h | 206 uint64_t hash = 2166136261; in FNVHash() local 210 hash = (hash ^ keyVal) * NFV_PRIME; in FNVHash() 212 hash += hash << PRIME_OFFSET_4; in FNVHash() 213 hash ^= hash >> PRIME_OFFSET_3; in FNVHash() 214 hash += hash << PRIME_OFFSET_1; in FNVHash() 215 hash ^= hash >> PRIME_OFFSET_5; in FNVHash() 216 hash += hash << PRIME_OFFSET_2; in FNVHash() 217 return hash % MAX_KEY_NUM; in FNVHash()
|
/ohos5.0/foundation/communication/dsoftbus/core/bus_center/utils/src/ |
H A D | lnn_map.c | 37 uint32_t hash = 0; in MapHash() local 44 hash = (hash * seed) + (*key++); in MapHash() 47 return (hash & 0x7FFFFFFF); in MapHash() 115 node->hash = hash; in MapCreateNode() 152 uint32_t hash = MapHash(key); in LnnMapSet() local 161 if (node->hash != hash || node->key == NULL || strcmp(node->key, key) != 0) { in LnnMapSet() 214 uint32_t hash = MapHash(key); in LnnMapGet() local 215 int32_t idx = MapHashIdx(map, hash); in LnnMapGet() 223 if (node->hash == hash && node->key != NULL && !strcmp(node->key, key)) { in LnnMapGet() 246 uint32_t hash = MapHash(key); in LnnMapErase() local [all …]
|
/ohos5.0/base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog_lite/ |
H A D | hiview_log.h | 415 void HILOG_HashPrintf(uint8 module, uint8 level, const char *nums, uint32 hash, ...); 426 #define HILOG_DEBUG_HASH(mod, hash, ...) \ argument 429 #define HILOG_DEBUG_HASH(mod, hash, ...) argument 441 #define HILOG_INFO_HASH(mod, hash, ...) \ argument 444 #define HILOG_INFO_HASH(mod, hash, ...) argument 456 #define HILOG_WARN_HASH(mod, hash, ...) \ argument 459 #define HILOG_WARN_HASH(mod, hash, ...) argument 471 #define HILOG_ERROR_HASH(mod, hash, ...) \ argument 474 #define HILOG_ERROR_HASH(mod, hash, ...) argument 486 #define HILOG_FATAL_HASH(mod, hash, ...) \ argument [all …]
|
/ohos5.0/foundation/graphic/graphic_3d/lume/metaobject/include/meta/base/ |
H A D | meta_types.h | 41 inline constexpr BASE_NS::Uid MakeUidImpl(uint64_t hash, const char (&type)[9]) in MakeUidImpl() argument 43 …uint8_t data[16u] { static_cast<uint8_t>((hash >> 56) & 0xFF), static_cast<uint8_t>((hash >> 48) &… in MakeUidImpl() 44 static_cast<uint8_t>((hash >> 40) & 0xFF), static_cast<uint8_t>((hash >> 32) & 0xFF), in MakeUidImpl() 45 static_cast<uint8_t>((hash >> 24) & 0xFF), static_cast<uint8_t>((hash >> 16) & 0xFF), in MakeUidImpl() 46 …static_cast<uint8_t>((hash >> 8) & 0xFF), static_cast<uint8_t>(hash & 0xFF), static_cast<uint8_t>(… in MakeUidImpl() 81 inline constexpr uint64_t CombineHash(uint64_t hash) in CombineHash() argument 84 return hash ^ in CombineHash() 86 (hash << 12) + (hash >> 4)); // 12 4 shift multiple in CombineHash() 95 uint64_t hash {}; in MakeUidFromTypes() 97 hash = (CombineHash<Types>(hash), ...); in MakeUidFromTypes() [all …]
|
/ohos5.0/foundation/graphic/graphic_2d/rosen/test/render_service/render_service_base/unittest/render/ |
H A D | rs_drawing_filter_test.cpp | 52 uint32_t hash = 1; variable 53 RSDrawingFilter drawingFilter(imageFilter, shaderFilters, hash); 72 uint32_t hash = 1; variable 99 uint32_t hash = 1; variable 138 uint32_t hash = 1; variable 161 uint32_t hash = 1; variable 184 uint32_t hash = 1; variable 187 drawingFilter.Compose(other, hash); 191 drawingFilter.Compose(other, hash); 207 uint32_t hash = 1; variable [all …]
|
/ohos5.0/foundation/distributedhardware/distributed_input/common/include/ |
H A D | white_list_util.cpp | 239 WhiteListItemHash hash; in GetCombKeysHash() local 240 GetAllComb(combKeys, hash, combKeys.size(), hashSets); in GetCombKeysHash() 253 std::string hashStr = hash.hash + std::to_string(code); in GetAllComb() 261 if (hash.len == targetLen) { in GetAllComb() 262 hashSets.insert(hash.hash); in GetAllComb() 300 std::string hash = ""; in GetBusinessEventHash() local 302 hash += std::to_string(p); in GetBusinessEventHash() 304 hash += std::to_string(event.keyCode); in GetBusinessEventHash() 305 hash += std::to_string(event.keyAction); in GetBusinessEventHash() 307 return hash; in GetBusinessEventHash() [all …]
|
/ohos5.0/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
H A D | hks_mbedtls_hash.c | 115 ret = mbedtls_md5_finish_ret(context, hash->data); in HksMbedtlsHashMd5Final() 192 if (hash->data == NULL) { in HksMbedtlsHashSha1Final() 207 ret = mbedtls_sha1_finish_ret(context, hash->data); in HksMbedtlsHashSha1Final() 282 struct HksBlob *hash) in HksMbedtlsHashSha256Final() argument 289 if (hash->data == NULL) { in HksMbedtlsHashSha256Final() 304 ret = mbedtls_sha256_finish_ret(context, hash->data); in HksMbedtlsHashSha256Final() 381 struct HksBlob *hash) in HksMbedtlsHashSha512Final() argument 388 if (hash->data == NULL) { in HksMbedtlsHashSha512Final() 403 ret = mbedtls_sha512_finish_ret(context, hash->data); in HksMbedtlsHashSha512Final() 560 ret = HksGetDigestLen(hashCtx->mAlg, &(hash->size)); in HksMbedtlsHashFinal() [all …]
|
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/render_service_base/src/render/ |
H A D | rs_drawing_filter.cpp | 54 imageFilterHash_ = hash; in RSDrawingFilter() 70 imageFilterHash_ = hash; in RSDrawingFilter() 76 std::vector<std::shared_ptr<RSShaderFilter>> shaderFilters, uint32_t hash) in RSDrawingFilter() argument 81 uint32_t hash = shaderFilter->Hash(); in RSDrawingFilter() local 82 hash_ = SkOpts::hash(&hash, sizeof(hash), hash_); in RSDrawingFilter() 84 imageFilterHash_ = hash; in RSDrawingFilter() 191 auto hash = SkOpts::hash(&imageFilterHash_, sizeof(imageFilterHash_), hash_); in Hash() local 192 return hash; in Hash() 234 result->hash_ = SkOpts::hash(&otherHash, sizeof(otherHash), hash_); in Compose() 239 const std::shared_ptr<Drawing::ImageFilter> other, uint32_t hash) const in Compose() [all …]
|
H A D | rs_mesa_blur_shader_filter.cpp | 63 hash_ = SkOpts::hash(&radius_, sizeof(radius_), 0); in CalculateHash() 64 hash_ = SkOpts::hash(&greyCoefLow_, sizeof(greyCoefLow_), hash_); in CalculateHash() 65 hash_ = SkOpts::hash(&greyCoefHigh_, sizeof(greyCoefHigh_), hash_); in CalculateHash() 67 hash_ = SkOpts::hash(&localParams->offsetX_, sizeof(localParams->offsetX_), hash_); in CalculateHash() 68 hash_ = SkOpts::hash(&localParams->offsetY_, sizeof(localParams->offsetY_), hash_); in CalculateHash() 69 hash_ = SkOpts::hash(&localParams->offsetZ_, sizeof(localParams->offsetZ_), hash_); in CalculateHash() 70 hash_ = SkOpts::hash(&localParams->offsetW_, sizeof(localParams->offsetW_), hash_); in CalculateHash() 71 hash_ = SkOpts::hash(&localParams->tileMode_, sizeof(localParams->tileMode_), hash_); in CalculateHash() 72 hash_ = SkOpts::hash(&localParams->width_, sizeof(localParams->width_), hash_); in CalculateHash() 73 hash_ = SkOpts::hash(&localParams->height_, sizeof(localParams->height_), hash_); in CalculateHash()
|
/ohos5.0/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/ |
H A D | hks_openssl_hash.c | 66 static int32_t HashCheckParam(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash) in HashCheckParam() argument 70 …HKS_IF_NOT_SUCC_LOGE_RETURN(HksOpensslCheckBlob(hash), HKS_ERROR_INVALID_ARGUMENT, "Invalid param … in HashCheckParam() 76 int32_t HksOpensslHash(uint32_t alg, const struct HksBlob *msg, struct HksBlob *hash) in HksOpensslHash() argument 78 int32_t ret = HashCheckParam(alg, msg, hash); in HksOpensslHash() 84 ret = EVP_Digest(msg->data, msg->size, hash->data, &hash->size, opensslAlg, NULL); in HksOpensslHash() 134 int32_t HksOpensslHashFinal(void **cryptoCtx, const struct HksBlob *msg, struct HksBlob *hash) in HksOpensslHashFinal() argument 147 if (HksOpensslCheckBlob(hash) != HKS_SUCCESS) { in HksOpensslHashFinal() 165 ret = EVP_DigestFinal_ex((EVP_MD_CTX *)*cryptoCtx, hash->data, &hash->size); in HksOpensslHashFinal()
|
/ohos5.0/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework/utils/ |
H A D | crypto.cpp | 38 unsigned char hash[SHA256_DIGEST_LENGTH * 2 + 1] = ""; in Sha256() local 42 SHA256_Final(&hash[SHA256_DIGEST_LENGTH], &ctx); in Sha256() 48 unsigned char value = hash[SHA256_DIGEST_LENGTH + i]; in Sha256() 50 hash[i * 2] = hexCode[(value >> WIDTH) & MASK]; in Sha256() 52 hash[i * 2 + 1] = hexCode[value & MASK]; in Sha256() 55 hash[SHA256_DIGEST_LENGTH * 2] = 0; in Sha256() 56 return reinterpret_cast<char *>(hash); in Sha256()
|
/ohos5.0/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/test/ |
H A D | object_asset_machine_test.cpp | 55 .hash = "modifyTime_size", in SetUp() 101 .hash = "modifyTime2_size2", 108 ASSERT_EQ(changedAssets_[uri_].asset.hash, asset.hash); 125 .hash = "modifyTime2_size2", 147 .hash = "modifyTime1_size1", 154 ASSERT_EQ(changedAssets_[uri_].asset.hash, asset.hash); 171 .hash = "modifyTime1_size1", 197 .hash = "modifyTime_size_" + timestamp, 221 ASSERT_EQ(changedAssetInfo.asset.hash, asset.hash); 241 .hash = "modifyTime_006_size_006",
|
/ohos5.0/foundation/resourceschedule/ffrt/benchmarks/base/ |
H A D | base.cpp | 74 uint64_t hash = 14695981039346656037ULL; in BenchmarkNative() local 76 hash = (hash * 1099511628211ULL) ^ arr[i]; in BenchmarkNative() 79 return hash; in BenchmarkNative() 105 uint64_t hash = 14695981039346656037ULL; in BenchmarkFFRT() local 107 hash = (hash * 1099511628211ULL) ^ arr[i]; in BenchmarkFFRT() 110 return hash; in BenchmarkFFRT()
|
/ohos5.0/foundation/graphic/graphic_3d/lume/LumeRender/src/vulkan/ |
H A D | gpu_memory_allocator_vk.cpp | 76 uint64_t BASE_NS::hash(const RENDER_NS::GpuBufferDesc& desc) in hash() function in BASE_NS 90 uint64_t BASE_NS::hash(const RENDER_NS::GpuImageDesc& desc) in hash() function in BASE_NS 368 const uint64_t hash = BASE_NS::hash(desc); in GetBufferPool() local 379 const uint64_t hash = BASE_NS::hash(desc); in GetImagePool() local 432 const uint64_t hash = BASE_NS::hash(buf); in CreatePoolForBuffers() local 433 const size_t hashCount = hashToGpuBufferPoolIndex_.count(hash); in CreatePoolForBuffers() 483 const uint64_t hash = BASE_NS::hash(img); in CreatePoolForImages() local 484 const size_t hashCount = hashToGpuImagePoolIndex_.count(hash); in CreatePoolForImages() 494 hashToGpuImagePoolIndex_[hash] = static_cast<uint32_t>(customGpuImagePools_.size()) - 1; in CreatePoolForImages() 504 const size_t hash = BASE_NS::hash(desc); in GetBufferPoolDebugName() local [all …]
|
/ohos5.0/base/update/updater/services/package/pkg_verify/ |
H A D | pkg_verify_util.cpp | 82 std::vector<uint8_t> hash; in VerifySign() local 83 int32_t ret = Pkcs7verify(signData, hash); in VerifySign() 89 size_t hashLen = hash.size(); in VerifySign() 113 std::vector<uint8_t> hash; in VerifyPackageSign() local 114 int32_t ret = Pkcs7verify(signature, hash); in VerifyPackageSign() 122 ret = HashCheck(pkgStream, srcDataLen, hash, path); in VerifyPackageSign() 125 ret = HashCheck(pkgStream, srcDataLen, hash, path); in VerifyPackageSign() 185 return pkcs7.GetHashFromSignBlock(signature.data(), signature.size(), hash); in Pkcs7verify() 189 const std::vector<uint8_t> &hash, const std::string &path) const in HashCheck() argument 206 size_t digestLen = hash.size(); in HashCheck() [all …]
|
/ohos5.0/foundation/distributedhardware/device_manager/utils/src/crypto/ |
H A D | dm_crypto.cpp | 97 unsigned char hash[SHA256_DIGEST_LENGTH * HEX_TO_UINT8 + 1] = ""; in Sha256() local 102 unsigned char value = hash[SHA256_DIGEST_LENGTH + i]; in Sha256() 104 hash[i * HEX_TO_UINT8] = hexCode[(value >> WIDTH) & MASK]; in Sha256() 105 hash[i * HEX_TO_UINT8 + 1] = hexCode[value & MASK]; in Sha256() 107 hash[SHA256_DIGEST_LENGTH * HEX_TO_UINT8] = 0; in Sha256() 109 ss << hash; in Sha256() 115 unsigned char hash[SHA256_DIGEST_LENGTH] = ""; in GetUdidHash() local 116 DmGenerateStrHash(udid.data(), udid.size(), hash, SHA256_DIGEST_LENGTH, 0); in GetUdidHash() 167 unsigned char hash[SHA256_DIGEST_LENGTH] = ""; in GetGroupIdHash() local 168 DmGenerateStrHash(groupId.data(), groupId.size(), hash, SHA256_DIGEST_LENGTH, 0); in GetGroupIdHash() [all …]
|