Hash value

3 posts / 0 new
Last post
Robert van den ...
Offline
Joined: 08/08/2018 - 07:37
Hash value

Are there any function in IDEA or that can be called with a script to calculate a hash value of a string?

klmi
Offline
Joined: 02/13/2019 - 08:41

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

milos16t
Offline
Joined: 02/24/2023 - 02:57

THANK YOU!