projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'tests/authentication_plug' into 'develop'
[akkoma]
/
lib
/
pleroma
/
flake_id.ex
diff --git
a/lib/pleroma/flake_id.ex
b/lib/pleroma/flake_id.ex
index 9f098ce3378f0ce5deeb2ea2bb03e9804e56f80d..58ab3650dc952de4465c30a77cbcf78f06b11e66 100644
(file)
--- a/
lib/pleroma/flake_id.ex
+++ b/
lib/pleroma/flake_id.ex
@@
-46,7
+46,7
@@
defmodule Pleroma.FlakeId do
def from_string(string) when is_binary(string) and byte_size(string) < 18 do
case Integer.parse(string) do
def from_string(string) when is_binary(string) and byte_size(string) < 18 do
case Integer.parse(string) do
- {id,
_
} -> <<0::integer-size(64), id::integer-size(64)>>
+ {id,
""
} -> <<0::integer-size(64), id::integer-size(64)>>
_ -> nil
end
end
_ -> nil
end
end
@@
-85,7
+85,7
@@
defmodule Pleroma.FlakeId do
{:ok, FlakeId.from_string(value)}
end
{:ok, FlakeId.from_string(value)}
end
- def autogenerate
()
, do: get()
+ def autogenerate, do: get()
# -- GenServer API
def start_link do
# -- GenServer API
def start_link do
@@
-165,7
+165,7
@@
defmodule Pleroma.FlakeId do
1_000_000_000 * mega_seconds + seconds * 1000 + :erlang.trunc(micro_seconds / 1000)
end
1_000_000_000 * mega_seconds + seconds * 1000 + :erlang.trunc(micro_seconds / 1000)
end
- defp worker_id
()
do
+ defp worker_id do
<<worker::integer-size(48)>> = :crypto.strong_rand_bytes(6)
worker
end
<<worker::integer-size(48)>> = :crypto.strong_rand_bytes(6)
worker
end