Package for zx #45
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "zomp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This packages the library for deployment on zx (migrating from the old otpr-aeserialization-* line).
It also adds a native Erlang fallback to invokation of the Blake2 algorithm, picking enacl if it is present, but proceeding with eblake2 if not.
@ -6,6 +6,7 @@
%%% @end
%%%-------------------------------------------------------------------
-module(gmser_api_encoder).
-vsn("0.1.2").
I am wondering if we plan keeping all of those versions in sync somehow, ex. when we change the encoder version, do we also bump the chain objects one? How would we test for compatibility?
Those are added by zx but could be omitted. The versions are clearly not in sync across projects (the version of serialization has never been in sync with bytecode or the compiler, for example).
@ -51,0 +58,4 @@
% syncing a new node, for example).
blake2(Size, Bin) ->
try
enacl:generichash(Size, Bin)
Actually, the slowest part of the error throwing machinery isn't the
catch
(it's actually very fast if not capturing stacktraces, and pretty fast even then), but thecode:ensure_loaded/1
call needed before throwing anundef
error.If we can know (through initialization logic) that
enacl
will be loaded at this point, if present at all, we can useerlang:function_exported(enacl, generichash, 2)
.Does that make the failed case more efficient?
I'm not sure where in initialization we could discover which case we're in, so I left it at call time.
@ -0,0 +9,4 @@
{key_name,none}.
{a_email,[]}.
{c_email,[]}.
{copyright,"Hans Svensson"}.
Is this correct?
Ah, copyright, no. I think.