Skip to content

Commit

Permalink
Update hex.repo.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 25, 2020
1 parent f5aad43 commit 08db1b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mix/tasks/hex.repo.ex
Expand Up @@ -223,8 +223,11 @@ defmodule Mix.Tasks.Hex.Repo do
end

defp sshfp_string(key) do
# The padding: false on Base.encode64 requires Elixir v1.3+,
# so we do a String.replace/3 instead.
:crypto.hash(:sha256, :public_key.ssh_encode(key, :ssh2_pubkey))
|> Base.encode64(padding: false)
|> Base.encode64()
|> String.replace("=", "")
end

defp show(name) do
Expand Down

0 comments on commit 08db1b7

Please sign in to comment.