Skip to content

Commit

Permalink
Merge pull request #192 from keboola/CF-3206-update/support-for-hash-…
Browse files Browse the repository at this point in the history
…function-sync-action

UPDATE/CF-3206 - Added support for hash function - sync action
  • Loading branch information
themark147 authored Nov 19, 2024
2 parents 954663d + 11e3e33 commit a232584
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions python-sync-actions/src/user_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ def hash_hmac(self, algorithm, key, message):

return stdout

def hash(self, algorithm, message):
"""
Execute PHP hash function
Args:
algorithm:
message:
Returns:
"""

command = f"php -r 'echo hash(\"{algorithm}\", \"{message}\");'"
stdout, stderr = perform_shell_command(command, 'hash function')

return stdout

def time(self):
return int(time.time())

Expand Down

0 comments on commit a232584

Please sign in to comment.