Serializable
, Key
, SecretKey
, Destroyable
, ChaosKey
public class ChaosKeyImpl extends Object implements ChaosKey, SecretKey
Modifier and Type | Field | Description |
---|---|---|
static String |
PROVIDER_NAME |
Constructor | Description |
---|---|
ChaosKeyImpl(double x0,
double a,
double s) |
Instantiates a new chaos key.
|
ChaosKeyImpl(int x0,
int a,
int s) |
Instantiates a new chaos key from the provided integer values.
|
ChaosKeyImpl(String aSecret) |
Instantiates a new chaos key by calculating x0, a and s from the provided
String . |
Modifier and Type | Method | Description |
---|---|---|
double |
getA() |
Gets the a.
|
String |
getAlgorithm() |
|
byte[] |
getEncoded() |
|
String |
getFormat() |
|
double |
getS() |
Gets the s.
|
double |
getX0() |
Gets the x0.
|
protected static double |
toA(int a) |
Creates a valid a double from the provided integer (values from
Integer.MIN_VALUE to Integer.MAX_VALUE are allowed. |
protected static double |
toS(int s) |
Creates a valid s double from the provided integer (values from
Integer.MIN_VALUE to Integer.MAX_VALUE are allowed. |
protected static double |
toX0(int x0) |
Creates a valid x0 double from the provided integer (values from
Integer.MIN_VALUE to Integer.MAX_VALUE are allowed. |
protected static void |
validate(double x0,
double a,
double s) |
Validates the given values whether them are in scope.
|
destroy, isDestroyed
public static final String PROVIDER_NAME
public ChaosKeyImpl(String aSecret)
String
.aSecret
- The String
from which to calculate x0, a and s.public ChaosKeyImpl(int x0, int a, int s)
ChaosKeyImpl(double, double, double)
. You can
use values in the range of Integer.MIN_VALUE
and
Integer.MAX_VALUE
.x0
- The value from which to calculate the valid x0 double.a
- The value from which to calculate the valid a double.s
- The value from which to calculate the valid s double.public ChaosKeyImpl(double x0, double a, double s)
x0
- the x0: (0 <= x0 <= 1 )a
- the a: (a <= 3.57 <= 4 )s
- the s: (s > Integer.MAX_VALUE
)public String getAlgorithm()
getAlgorithm
in interface Key
public byte[] getEncoded()
getEncoded
in interface Key
protected static double toX0(int x0)
Integer.MIN_VALUE
to Integer.MAX_VALUE
are allowed.x0
- The integer as source for x0protected static double toA(int a)
Integer.MIN_VALUE
to Integer.MAX_VALUE
are allowed.a
- The integer as source for aprotected static double toS(int s)
Integer.MIN_VALUE
to Integer.MAX_VALUE
are allowed.s
- The integer as source for sprotected static void validate(double x0, double a, double s)
x0
- The x0 value to validate.a
- The a value to validate.s
- The s value to validate.Copyright © 2018. All rights reserved.