Exemple #1
0
uint8_vec xor_vec(uint8_vec const &a, uint8_vec const &b) {
    uint8_vec v;
    v.reserve(std::min(a.size(), b.size()));

    for (uint8_vec::const_iterator i = a.begin(), j = b.begin(); i != a.end() && j != b.end(); ++i, ++j) {
        v.push_back(*i ^ *j);
    }

    return v;
}
Exemple #2
0
bool file_utils::write_vec_to_file(const char *pPath, const uint8_vec &data)
{
    return write_buf_to_file(pPath, data.get_ptr(), data.size());
}