mirror of
https://github.com/biergaizi/codecrypt
synced 2024-06-30 02:43:06 +00:00
12 lines
164 B
C++
12 lines
164 B
C++
![]() |
|
||
|
#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;
|
||
|
}
|
||
|
|