Skip to content

Commit

Permalink
feat(mssql): add md2 and md4 hashbytes algos
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek committed Nov 26, 2024
1 parent 9862843 commit 3d8b6e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ibis/backends/sql/compilers/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def visit_Not(self, op, *, arg):
return self.if_(arg, 1, 0).eq(0)

def visit_HashBytes(self, op, *, arg, how):
if how in ("md5", "sha1"):
if how in ("md2", "md4", "md5", "sha1"):
return self.f.hashbytes(how, arg)
elif how == "sha256":
return self.f.hashbytes("sha2_256", arg)
Expand Down
4 changes: 4 additions & 0 deletions ibis/expr/operations/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ class Hash(Value):
class HashBytes(Value):
arg: Value[dt.String | dt.Binary]
how: LiteralType[
"md2",
"MD2",
"md4",
"MD4",
"md5",
"MD5",
"sha1",
Expand Down

0 comments on commit 3d8b6e0

Please sign in to comment.