Hash value
Robert van den…
Forums
Are there any function in IDEA or that can be called with a script to calculate a hash value of a string?
Are there any function in IDEA or that can be called with a script to calculate a hash value of a string?
Create the file "sha256.py"
Step 1: Create a file "sha256.py" in your folder of user defined functions and copy that code into the file:
import hashlib
def sha256(s1):
return hashlib.sha256(s1.encode()).hexdigest()
Step 2: Create a new field in your IDEA database and use as equation:
@Python("sha256";FIELD_TO_HASH)
FIELD_TO_HASH is the name of the field for which you want to calucate the hash.
* IDEA 10.3 or higher necessary for integrated Python support
** "Run Python-Scripts" must be checked in preferences