本文整理汇总了C++中MD5Hash::append方法的典型用法代码示例。如果您正苦于以下问题:C++ MD5Hash::append方法的具体用法?C++ MD5Hash::append怎么用?C++ MD5Hash::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MD5Hash
的用法示例。
在下文中一共展示了MD5Hash::append方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: array_hash
static void array_hash(const Node *node, const SocketType& socket, MD5Hash& md5)
{
const array<T>& a = *(const array<T>*)(((char*)node) + socket.struct_offset);
for (size_t i = 0; i < a.size(); i++) {
md5.append((uint8_t*)&a[i], sizeof(T));
}
}
示例2: sizeof
static void float3_array_hash(const Node *node, const SocketType& socket, MD5Hash& md5)
{
/* Don't compare 4th element used for padding. */
const array<float3>& a = *(const array<float3>*)(((char*)node) + socket.struct_offset);
for (size_t i = 0; i < a.size(); i++) {
md5.append((uint8_t*)&a[i], sizeof(float) * 3);
}
}
示例3:
const string& CacheData::get_filename()
{
if(!have_filename) {
MD5Hash hash;
foreach(const CacheBuffer& buffer, buffers)
if(buffer.size)
hash.append((uint8_t*)buffer.data, buffer.size);
filename = name + "_" + hash.get_hex();
have_filename = true;
}
示例4: hash
void Node::hash(MD5Hash& md5)
{
md5.append(type->name.string());
foreach(const SocketType& socket, type->inputs) {
md5.append(socket.name.string());
switch(socket.type) {
case SocketType::BOOLEAN: value_hash<bool>(this, socket, md5); break;
case SocketType::FLOAT: value_hash<float>(this, socket, md5); break;
case SocketType::INT: value_hash<int>(this, socket, md5); break;
case SocketType::UINT: value_hash<uint>(this, socket, md5); break;
case SocketType::COLOR: float3_hash(this, socket, md5); break;
case SocketType::VECTOR: float3_hash(this, socket, md5); break;
case SocketType::POINT: float3_hash(this, socket, md5); break;
case SocketType::NORMAL: float3_hash(this, socket, md5); break;
case SocketType::POINT2: value_hash<float2>(this, socket, md5); break;
case SocketType::CLOSURE: break;
case SocketType::STRING: value_hash<ustring>(this, socket, md5); break;
case SocketType::ENUM: value_hash<int>(this, socket, md5); break;
case SocketType::TRANSFORM: value_hash<Transform>(this, socket, md5); break;
case SocketType::NODE: value_hash<void*>(this, socket, md5); break;
case SocketType::BOOLEAN_ARRAY: array_hash<bool>(this, socket, md5); break;
case SocketType::FLOAT_ARRAY: array_hash<float>(this, socket, md5); break;
case SocketType::INT_ARRAY: array_hash<int>(this, socket, md5); break;
case SocketType::COLOR_ARRAY: float3_array_hash(this, socket, md5); break;
case SocketType::VECTOR_ARRAY: float3_array_hash(this, socket, md5); break;
case SocketType::POINT_ARRAY: float3_array_hash(this, socket, md5); break;
case SocketType::NORMAL_ARRAY: float3_array_hash(this, socket, md5); break;
case SocketType::POINT2_ARRAY: array_hash<float2>(this, socket, md5); break;
case SocketType::STRING_ARRAY: array_hash<ustring>(this, socket, md5); break;
case SocketType::TRANSFORM_ARRAY: array_hash<Transform>(this, socket, md5); break;
case SocketType::NODE_ARRAY: array_hash<void*>(this, socket, md5); break;
case SocketType::UNDEFINED: break;
}
}
}
示例5: it
static void path_files_md5_hash_recursive(MD5Hash& hash, const string& dir)
{
if(path_exists(dir)) {
directory_iterator it(dir), it_end;
for(; it != it_end; ++it) {
if(path_is_directory(it->path())) {
path_files_md5_hash_recursive(hash, it->path());
}
else {
string filepath = it->path();
hash.append((const uint8_t*)filepath.c_str(), filepath.size());
hash.append_file(filepath);
}
}
}
}
示例6: it
static void path_files_md5_hash_recursive(MD5Hash& hash, const string& dir)
{
if(boost::filesystem::exists(dir)) {
boost::filesystem::directory_iterator it(dir), it_end;
for(; it != it_end; it++) {
if(boost::filesystem::is_directory(it->status())) {
path_files_md5_hash_recursive(hash, it->path().string());
}
else {
string filepath = it->path().string();
hash.append((const uint8_t*)filepath.c_str(), filepath.size());
hash.append_file(filepath);
}
}
}
}
示例7: value_hash
static void value_hash(const Node *node, const SocketType& socket, MD5Hash& md5)
{
md5.append(((uint8_t*)node) + socket.struct_offset, socket.size());
}