From bd221cb3e9ba8cdeeaafd0ce115ee6fcfe62e6b4 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Tue, 27 Aug 2024 20:12:07 +0200 Subject: [PATCH] Let's try to make it a bit faster --- lib/global_api/skins/skin_storage.ex | 2 +- mix.exs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/global_api/skins/skin_storage.ex b/lib/global_api/skins/skin_storage.ex index 3f29ec6..4398c75 100644 --- a/lib/global_api/skins/skin_storage.ex +++ b/lib/global_api/skins/skin_storage.ex @@ -31,7 +31,7 @@ defmodule GlobalApi.Skins.SkinStorage do ]) |> Jason.encode!() - identifier = Blake2.hash2b(final_data, 32) + identifier = :crypto.hash(:blake2b, final_data) DatabaseQueue.async_fn_call(fn -> Repo.insert(%Schema{hash: identifier, skin: final_data, code: convert_code}, on_conflict: :nothing) diff --git a/mix.exs b/mix.exs index 0408c90..7b544e6 100644 --- a/mix.exs +++ b/mix.exs @@ -39,7 +39,6 @@ defmodule GlobalApi.MixProject do # Type `mix help deps` for examples and options. defp deps do [ - {:blake2, "~> 1.0.4"}, {:phoenix, "~> 1.6.13"}, {:phoenix_live_reload, "~> 1.3.3", only: :dev}, {:phoenix_live_view, "~> 0.18.1"},