17 for (
size_t i = 0;
i <
len;
i++) {
18 ctx->count[data[
i]]++;
26 double p, entropy = 0.0;
28 for (
size_t i = 0;
i < 256;
i++) {
32 entropy -=
p * log2(
p);
35 if (fraction &&
ctx->size) {
36 entropy /= log2((
double)
RZ_MIN(
ctx->size, 256));
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
bool rz_entropy_init(RzEntropy *ctx)
bool rz_entropy_final(ut8 *digest, RzEntropy *ctx, bool fraction)
bool rz_entropy_update(RzEntropy *ctx, const ut8 *data, size_t len)
return memset(p, 0, total)
#define rz_return_val_if_fail(expr, val)
static void rz_write_be_double(void *dest, double val)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()