Пример #1
0
// static
void LLPanelLogin::onClickID0Random(void* userData)
{
	LLPanelLogin* panel = (LLPanelLogin*)userData;
	unsigned char seed[16];		/* Flawfinder: ignore */
	LLUUID::getNodeID(&seed[0]);
	seed[6]='W';
	seed[7]='U';
	LLUUID::getSystemTime((uuid_time_t *)(&seed[8]));

	char hash_string[MD5HEX_STR_SIZE];
	LLMD5 hash;
	hash.update( seed , 16 );
	hash.finalize();
	hash.hex_digest(hash_string);
	gSavedSettings.setString("SpecifiedID0",std::string(hash_string));
	panel->fillID0();
}
Пример #2
0
LLUUID LLWearableData::computeBakedTextureHash(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index,
												 BOOL generate_valid_hash) // Set to false if you want to upload the baked texture w/o putting it in the cache
{
	LLUUID hash_id;
	bool hash_computed = false;
	LLMD5 hash;
	const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index);

	for (U8 i=0; i < baked_dict->mWearables.size(); i++)
	{
		const LLWearableType::EType baked_type = baked_dict->mWearables[i];
		const U32 num_wearables = getWearableCount(baked_type);
		for (U32 index = 0; index < num_wearables; ++index)
		{
			const LLWearable* wearable = getWearable(baked_type,index);
			if (wearable)
			{
				wearable->addToBakedTextureHash(hash);
				hash_computed = true;
			}
		}
	}
	if (hash_computed)
	{
		hash.update((const unsigned char*)baked_dict->mWearablesHashID.mData, UUID_BYTES);

		if (!generate_valid_hash)
		{
			invalidateBakedTextureHash(hash);
		}
		hash.finalize();
		hash.raw_digest(hash_id.mData);
	}

	return hash_id;
}
// virtual
void LLViewerWearable::addToBakedTextureHash(LLMD5& hash) const
{
	LLUUID asset_id = getAssetID();
	hash.update((const unsigned char*)asset_id.mData, UUID_BYTES);
}