port over some more
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user