1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-30 02:43:06 +00:00
codecrypt/lib/bvector.cpp

12 lines
164 B
C++
Raw Normal View History

2012-04-01 11:51:59 +00:00
#include "codecrypt.h"
using namespace ccr;
uint bvector::hamming_weight()
{
uint r = 0;
for (uint i = 0; i < size(); ++i) if ( (*this) [i]) ++r;
return r;
}