Skip to content

Commit

Permalink
Merge pull request #276 from spunkedy/feature-fips
Browse files Browse the repository at this point in the history
fips compatable hash
  • Loading branch information
mruoss committed May 30, 2024
2 parents 171d01c + 67069bb commit 301a53f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/bonny/operator/leader_elector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ defmodule Bonny.Operator.LeaderElector do

defp lease_name(operator) do
operator_hash =
:crypto.hash(:md5, Atom.to_string(operator)) |> Base.encode16() |> String.downcase()
:crypto.hash(:sha, Atom.to_string(operator))
|> String.slice(0..15)
|> Base.encode16()
|> String.downcase()

"#{Bonny.Config.namespace()}-#{Bonny.Config.name()}-#{operator_hash}"
end
Expand Down

0 comments on commit 301a53f

Please sign in to comment.