Hashlib.py ignition implementation

Hi,

I would like to implement the (3rd party)python hashlib.py in Ignition, but the library depends on C / C-Python features.

Is there an other way to use hashlib functionality in Ignition?

Sadly no official way, but there are some workarounds.

Ignition is based on Java, so uses Jython. And Jython can only use pure Python (that doesn’t depend on C).

There are a few options open:

  • Find a different Python library (pure Python)
  • Use the subprocess module to run a CPython file via the command line
  • Use some standard Java class that provides hashing like MessageDigest

Hashlib is already a standard library.

EDIT: Sorry, got called away for a bit. Anyway, you can use the hashlib standard library, or you can leverage MessageDigest, as Sander already pointed out.