Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在数据导入时,我应该应用以下转换:
if value: return hashlib.sha512(value + salt).hexdigest()
如何将它与 import_transform 一起使用?
以下帮助:
import_transform: "lambda x: hashlib.sha512(x.encode('utf-8') + 'actual_salt_value').hexdigest()"
更新。当上传文件中缺少字段时,以下代码处理这种情况:
import_transform: "lambda x: None if x is None or x=='' else hashlib.sha512(x.encode('utf-8') + 'actual_salt_value').hexdigest()"