mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-31 19:36:44 +01:00
use stronger hash function for anonymous names
This commit is contained in:
parent
a656f64225
commit
41f144b32b
1 changed files with 3 additions and 1 deletions
|
@ -28,8 +28,10 @@ defmodule PhilomenaWeb.UserAttributionView do
|
|||
id = Attribution.object_identifier(object)
|
||||
user_id = Attribution.best_user_identifier(object)
|
||||
|
||||
{:ok, <<key::size(16)>>} = :pbkdf2.pbkdf2(:sha256, id <> user_id, salt, 100, 2)
|
||||
|
||||
hash =
|
||||
(:erlang.crc32(salt <> id <> user_id) &&& 0xFFFF)
|
||||
key
|
||||
|> Integer.to_string(16)
|
||||
|> String.pad_leading(4, "0")
|
||||
|
||||
|
|
Loading…
Reference in a new issue