Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Entropy/AutoHotkey/entropy.ahk
Normal file
18
Task/Entropy/AutoHotkey/entropy.ahk
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
MsgBox, % Entropy(1223334444)
|
||||
|
||||
Entropy(n)
|
||||
{
|
||||
a := [], len := StrLen(n), m := n
|
||||
while StrLen(m)
|
||||
{
|
||||
s := SubStr(m, 1, 1)
|
||||
m := RegExReplace(m, s, "", c)
|
||||
a[s] := c
|
||||
}
|
||||
for key, val in a
|
||||
{
|
||||
m := Log(p := val / len)
|
||||
e -= p * m / Log(2)
|
||||
}
|
||||
return, e
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue