span8
span4
span8
span4
Ha,
it seems to be about the casing in setAttribute...
Works now!
import fmeimport fmeobjectsimport hashlibdef processFeature(feature): hash = hashlib.sha256() strOld = feature.getAttribute('inputstring') hash.update(strOld) # hash_object = hashlib.sha256(strOld.encode()) strNew = hash.hexdigest() att = 'hashcode' feature.setAttribute(att,strNew)
Hi,
I found this question,when I was looking for something similar.
I am quite unfamiliar with Python and therefor am struggling with my solution.So far I came up with this:
import fmeimport fmeobjects import hashlibdef processFeature(feature): hash = hashlib.sha256() strOld = feature.getAttribute('inputstring') hash.update(strOld) strNew = hash.hexdigest() feature.setattribute('hashcode',strNew)
© 2019 亚搏在线Safe Software Inc |Legal