Class SQLMethodHash
- java.lang.Object
-
- com.arcadedb.query.sql.method.misc.AbstractSQLMethod
-
- com.arcadedb.query.sql.function.text.SQLMethodHash
-
- All Implemented Interfaces:
SQLMethod
,Comparable<SQLMethod>
public class SQLMethodHash extends AbstractSQLMethod
Hash a string supporting multiple algorithm, all those supported by JVM- Author:
- Luca Garulli (l.garulli--(at)--gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description static String
HASH_ALGORITHM
static String
NAME
-
Constructor Summary
Constructors Constructor Description SQLMethodHash()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
byteArrayToHexStr(byte[] data)
static String
createHash(String iInput, String algorithm)
Object
execute(Object iThis, Identifiable iCurrentRecord, CommandContext iContext, Object ioResult, Object[] iParams)
Process a record.String
getSyntax()
Returns a convenient SQL String representation of the method.-
Methods inherited from class com.arcadedb.query.sql.method.misc.AbstractSQLMethod
compareTo, evaluateParameters, getMaxParams, getMinParams, getName, getParameterValue, toString
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
HASH_ALGORITHM
public static final String HASH_ALGORITHM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSyntax
public String getSyntax()
Description copied from interface:SQLMethod
Returns a convenient SQL String representation of the method.Example :
field.myMethod( param1, param2, [optionalParam3])
This text will be used in exception messages.
- Specified by:
getSyntax
in interfaceSQLMethod
- Overrides:
getSyntax
in classAbstractSQLMethod
- Returns:
- String , never null.
-
execute
public Object execute(Object iThis, Identifiable iCurrentRecord, CommandContext iContext, Object ioResult, Object[] iParams)
Description copied from interface:SQLMethod
Process a record.- Parameters:
iThis
- current objectiCurrentRecord
- : current recordiContext
- execution contextioResult
- : field valueiParams
- : function parameters, number is ensured to be within minParams and maxParams.- Returns:
- evaluation result
-
createHash
public static String createHash(String iInput, String algorithm) throws NoSuchAlgorithmException, UnsupportedEncodingException
-
byteArrayToHexStr
public static String byteArrayToHexStr(byte[] data)
-
-