public abstract class BaseMatch extends Object implements Match
Match.| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
configuration |
protected static double |
LOG_10 |
protected static double |
LOG_129 |
protected static double |
LOG_2 |
protected static double |
LOG_26 |
protected static double |
LOG_37200 |
protected static double |
LOG_47988 |
| Constructor and Description |
|---|
BaseMatch(String match,
Configuration configuration,
int start_index,
int end_index)
Create a new
BaseMatch |
| Modifier and Type | Method and Description |
|---|---|
double |
calculateEntropy()
Calculate the entropy for the current match
|
String |
getDetails()
Returns details about this match in the form of a String to be printed directly
|
int |
getEndIndex()
Returns the end index of this part of the password
|
int |
getLength()
Returns the length of this part of the password
|
int |
getStartIndex()
Returns the start index of this part of the password
|
String |
getToken() |
protected static double |
log2(double value)
Calculate the base 2 logarithm of a value
|
protected static long |
nCk(int n,
int k)
Calculate binomial coefficients (the number of possible "choose k among n")
|
protected void |
setEntropy(double entropy) |
protected static final double LOG_2
protected static final double LOG_10
protected static final double LOG_26
protected static final double LOG_129
protected static final double LOG_37200
protected static final double LOG_47988
protected final Configuration configuration
public BaseMatch(String match, Configuration configuration, int start_index, int end_index)
BaseMatchmatch - the String we are creating the BaseMatch from.configuration - the Configuration object.start_index - the start index in the password for this match.end_index - the end index in the password for this match.protected static double log2(double value)
value - the double we are calculating the log fromprotected static long nCk(int n,
int k)
n - the total size of the setk - the size of the selectionprotected void setEntropy(double entropy)
public final double calculateEntropy()
MatchcalculateEntropy in interface Matchdouble representing the entropy of the current Match.public String getToken()
public int getStartIndex()
MatchgetStartIndex in interface Matchint start index of this Match.public int getEndIndex()
MatchgetEndIndex in interface Matchint end index of this Match.public int getLength()
Matchpublic String getDetails()
MatchgetDetails in interface MatchMatch in printable String format.Copyright © 2017. All rights reserved.