Add the #oid{} record to differentiate from a formatted hash

This commit is contained in:
Carlos Martín Nieto
2013-01-29 01:38:15 +01:00
parent 5a58abc4a0
commit 8a96f4732e
3 changed files with 14 additions and 7 deletions

View File

@@ -1,12 +1,14 @@
-module(geef_oid).
-include("geef_records.hlr").
-export([parse/1, fmt/1]).
-spec fmt(binary()) -> binary().
fmt(Oid) ->
-spec fmt(oid()) -> binary().
fmt(#oid{oid=Oid}) ->
geef:oid_fmt(Oid).
-spec parse(binary()) -> binary().
-spec parse(binary()) -> oid().
parse(Sha) ->
geef:oid_parse(Sha).
Oid = geef:oid_parse(Sha),
#oid{oid=Oid}.