Content-Length: 209677 | pFad | http://github.com/esl/base16/commit/1e9dd28bdbcfb8f4aedf82b9900cfb0f094f137d

F1 Use binary() shorthand in specs. · esl/base16@1e9dd28 · GitHub
Skip to content

Commit

Permalink
Use binary() shorthand in specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
goj committed Sep 10, 2014
1 parent 751e3c4 commit 1e9dd28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/base16.erl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
%% Public API
%%--------------------------------------------------------------------

-spec encode(<<_:_*8>>) -> <<_:_*16>>.
-spec encode(binary()) -> <<_:_*16>>.
encode(Data) ->
<< <<(hex(N div 16)), (hex(N rem 16))>> || <<N>> <= Data >>.

-spec decode(<<_:_*16>>) -> <<_:_*8>>.
-spec decode(<<_:_*16>>) -> binary().
decode(Base16) when size(Base16) rem 2 =:= 0 ->
<< <<(unhex(H) bsl 4 + unhex(L))>> || <<H,L>> <= Base16 >>.

Expand Down

0 comments on commit 1e9dd28

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/esl/base16/commit/1e9dd28bdbcfb8f4aedf82b9900cfb0f094f137d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy