LightJason - AgentSpeak(L++)
org.lightjason.agentspeak.action.builtin.crypto.CHash Class Reference

hash algorithm. More...

+ Inheritance diagram for org.lightjason.agentspeak.action.builtin.crypto.CHash:
+ Collaboration diagram for org.lightjason.agentspeak.action.builtin.crypto.CHash:

Public Member Functions

final IFuzzyValue< Boolean > execute (final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
 defines a plan-body operation More...
 
final int minimalArgumentNumber ()
 minimum number of arguments More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
final IPath name ()
 returns the name with path of the action More...
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.IBaseAction
final boolean equals (final Object p_object)
 
final int hashCode ()
 
final String toString ()
 
- Public Member Functions inherited from org.lightjason.agentspeak.action.IAction
default Stream< IVariable<?> > variables ()
 returns a stream with all used variables More...
 

Static Private Member Functions

static String hash ( @Nonnull final IContext p_context, @Nonnull final String p_algorithm, @Nonnull final byte[] p_data)
 runs hashing function with difference between Google Guava hashing and Java default digest More...
 
static byte [] serialize ( @Nonnull final IContext p_context, @Nonnull final ITerm p_object)
 serialize data More...
 

Static Private Attributes

static final long serialVersionUID = 4638666396527392307L
 serial id More...
 

Additional Inherited Members

- Public Attributes inherited from org.lightjason.agentspeak.action.IAction
long serialVersionUID = -6374480398439703170L
 serial id More...
 
- Protected Member Functions inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
 IBuiltinAction ()
 ctor More...
 
 IBuiltinAction (final int p_length)
 ctor More...
 
- Static Protected Attributes inherited from org.lightjason.agentspeak.action.builtin.IBuiltinAction
static final Logger LOGGER = CCommon.logger( IBuiltinAction.class )
 logger More...
 
- Static Protected Attributes inherited from org.lightjason.agentspeak.action.IBaseAction
static final Logger LOGGER = org.lightjason.agentspeak.common.CCommon.logger( IAction.class )
 logger More...
 

Detailed Description

The actions creates a hash values of datasets, the first argument is the name of the hasing algorithm (Adler-32, CRC-32, CRC-32C, Murmur3-32, Murmur3-128, Siphash-2-4, MD2, MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512), for all other unflatten arguments a hash value is calculated and the action returns the hash values back and never fails

[Hash1 | Hash2 | Hash3] = crypto/hash( "Adler-32 | CRC-32 | CRC-32C | ...", Dataset1, Dataset2, Dataset3 );
See also
https://en.wikipedia.org/wiki/Secure_Hash_Algorithm
https://en.wikipedia.org/wiki/MD2_(cryptography)
https://en.wikipedia.org/wiki/MD5
https://en.wikipedia.org/wiki/Adler-32
https://en.wikipedia.org/wiki/Cyclic_redundancy_check
https://en.wikipedia.org/wiki/MurmurHash
https://en.wikipedia.org/wiki/SipHash
http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#MessageDigest
https://github.com/google/guava/wiki/HashingExplained

Definition at line 65 of file action/builtin/crypto/CHash.java.

Member Function Documentation

◆ execute()

final IFuzzyValue<Boolean> org.lightjason.agentspeak.action.builtin.crypto.CHash.execute ( final boolean  p_parallel,
@Nonnull final IContext  p_context,
@Nonnull final List< ITerm p_argument,
@Nonnull final List< ITerm p_return 
)
Parameters
p_parallelparallel execution
p_contextcurrent execution context
p_argumentparameter of the action
p_returnreturn values
Returns
fuzzy boolean

Implements org.lightjason.agentspeak.language.execution.IExecution.

Definition at line 81 of file action/builtin/crypto/CHash.java.

References org.lightjason.agentspeak.language.CRawTerm< T >.from(), org.lightjason.agentspeak.language.fuzzy.CFuzzyValue< T >.from(), org.lightjason.agentspeak.action.builtin.crypto.CHash.hash(), and org.lightjason.agentspeak.action.builtin.crypto.CHash.serialize().

Referenced by org.lightjason.agentspeak.action.builtin.TestCActionCrypto.hash(), and org.lightjason.agentspeak.action.builtin.TestCActionCrypto.hashexception().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hash()

static String org.lightjason.agentspeak.action.builtin.crypto.CHash.hash ( @Nonnull final IContext  p_context,
@Nonnull final String  p_algorithm,
@Nonnull final byte []  p_data 
)
staticprivate
Parameters
p_contextexecution context
p_algorithmalgorithm name
p_databyte data representation
Returns
hash value

Definition at line 126 of file action/builtin/crypto/CHash.java.

Referenced by org.lightjason.agentspeak.action.builtin.crypto.CHash.execute().

+ Here is the caller graph for this function:

◆ minimalArgumentNumber()

final int org.lightjason.agentspeak.action.builtin.crypto.CHash.minimalArgumentNumber ( )
Returns
number of minimal arguments

Implements org.lightjason.agentspeak.action.IAction.

Definition at line 74 of file action/builtin/crypto/CHash.java.

◆ serialize()

static byte [] org.lightjason.agentspeak.action.builtin.crypto.CHash.serialize ( @Nonnull final IContext  p_context,
@Nonnull final ITerm  p_object 
)
staticprivate
Parameters
p_contextexecution context
p_objectterm object
Returns
serialized bytes
Note
strings will be serialized always with utf-8 encoding, so comparing with md5sum is possible

Definition at line 104 of file action/builtin/crypto/CHash.java.

Referenced by org.lightjason.agentspeak.action.builtin.crypto.CHash.execute().

+ Here is the caller graph for this function:

Member Data Documentation

◆ serialVersionUID

final long org.lightjason.agentspeak.action.builtin.crypto.CHash.serialVersionUID = 4638666396527392307L
staticprivate

Definition at line 70 of file action/builtin/crypto/CHash.java.