port over some more

This commit is contained in:
ra
2026-02-14 23:58:01 -07:00
parent 0222be36c5
commit 61176cd416
107 changed files with 9124 additions and 375 deletions

View File

@@ -222,6 +222,21 @@ defmodule Odinsea.Net.Cipher.LoginCrypto do
end
end
@doc """
Hashes a second password (PIC) using SHA-1.
Used for second password storage.
## Parameters
- password: Plain text second password
## Returns
- Hex-encoded SHA-1 hash (lowercase)
"""
@spec hash_second_password(String.t()) :: String.t()
def hash_second_password(password) when is_binary(password) do
hex_sha1(password)
end
# Private helper: hash a string with a given digest algorithm
@spec hash_with_digest(String.t(), atom()) :: String.t()
defp hash_with_digest(input, digest) do