Get rid of the tagged OID
This means we no longer accept any iolist in some of the functions, but we might bring it back later. There is also a new function, geef_ref:create_symbolic() to create symbolic references, since we can no longer differentiate between a name and an OID.
This commit is contained in:
@@ -7,21 +7,20 @@
|
||||
|
||||
-include("geef_records.hrl").
|
||||
|
||||
-type oid() :: #geef_oid{oid :: binary()}.
|
||||
-type oid() :: <<_:160>>.
|
||||
-export_type([oid/0]).
|
||||
|
||||
-export([parse/1, hex/1]).
|
||||
|
||||
%% @doc Get a hex-encoded string of the hash
|
||||
-spec hex(geef_oid:oid()) -> binary().
|
||||
hex(#geef_oid{oid=Oid}) ->
|
||||
hex(Oid) ->
|
||||
geef_nif:oid_fmt(Oid).
|
||||
|
||||
%% @doc Parse an iolist as a hash
|
||||
-spec parse(iolist() | binary()) -> geef_oid:oid().
|
||||
-spec parse(iolist()) -> geef_oid:oid().
|
||||
parse(Sha) ->
|
||||
Oid = geef_nif:oid_parse(Sha),
|
||||
#geef_oid{oid=Oid}.
|
||||
geef_nif:oid_parse(Sha).
|
||||
|
||||
-ifdef(TEST).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user