Skip to content

Commit

Permalink
UPDATE/CF-3206 - Added support for hash function - sync action
Browse files Browse the repository at this point in the history
  • Loading branch information
themark147 committed Nov 8, 2024
1 parent 954663d commit 5a20bb0
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 5a20bb0

Please sign in to comment.