本文整理汇总了C++中Digest::CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Digest::CopyTo方法的具体用法?C++ Digest::CopyTo怎么用?C++ Digest::CopyTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Digest
的用法示例。
在下文中一共展示了Digest::CopyTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: merkle_tree_create
zx_status_t merkle_tree_create(const void* data, size_t data_len, void* tree, size_t tree_len,
void* out, size_t out_len) {
zx_status_t rc;
Digest digest;
if ((rc = MerkleTree::Create(data, data_len, tree, tree_len, &digest)) != ZX_OK) {
return rc;
}
return digest.CopyTo(static_cast<uint8_t*>(out), out_len);
}
示例2: merkle_tree_create_final
zx_status_t merkle_tree_create_final(merkle_tree_t* mt, void* tree, void* out, size_t out_len) {
// Must have a wrapper object.
if (!mt) {
return ZX_ERR_INVALID_ARGS;
}
// Take possession of the wrapper object. That way, we'll clean up
// automatically.
fbl::unique_ptr<merkle_tree_t> mt_uniq(mt);
// Call the C++ function.
zx_status_t rc;
Digest digest;
if ((rc = mt_uniq->obj.CreateFinal(tree, &digest)) != ZX_OK) {
return rc;
}
return digest.CopyTo(static_cast<uint8_t*>(out), out_len);
}