Is there a way to generate an MD5 hash in Corteza?
No.
MD5 has not been a supported protocol for ~20 years and will not meet any compliance requirement today.
Maybe share your need so some smart techie can make a recommendation?
Regards,
Paul
I want to create a unique hash value based on the timestamp and another field. Essentially to implement a digital signature of sorts.
SHA-256 is a widely used and secure hash function. It’s relatively fast and produces a 256-bit hash value.
Steps Involved:
- Combine the Data:
- Timestamp: Get the current timestamp in a suitable format (e.g., ISO 8601).
- Other Field: Obtain the value of the other field you want to include.
- Concatenate: Combine the timestamp and the other field into a single string, separated by a delimiter (e.g., a comma or a hyphen).
- Apply the Hash Function:
- Use a cryptographic library or tool to apply the SHA-256 hash function to the concatenated string.
- This will generate a unique hash value.
See if this is practical for your needs
Python:
`Pythonimport hashlib
import datetime
Get the current timestamp
timestamp = datetime.datetime.now().strftime(“%Y-%m-%d %H:%M:%S”)
Your other field
other_field = “some_value”
Combine the timestamp and other field
data_to_hash = timestamp + other_field
Calculate the SHA-256 hash
hash_object = hashlib.sha256(data_to_hash.encode(‘utf-8’))
hash_value = hash_object.hexdigest()
print(hash_value)`
This is exactly what I’m looking for (it’s been a long time since I’ve used a hashing algorithm for this purpose, so I guess I’m a little out of date).
Couple of questions:
Where do I run the Pythonimport hashlib and the import datetime commands?
The timestamp and other values can be set in the Expressions block of a workflow, correct?
Will need someone else to guide you there . . .
I’m not technical, but inherited an MD5 legacy issue some years back . . . found it and regurgitated seemingly appropriate solution pieces.
PS If you remember MD5, you just MIGHT be giving away your age OR that you are a serious history buff.
Probably that first one …
I’m leaning on the history buff thing . . .
Fibbing about being “39” for so long, have no intention of giving it up over MD5.