Skip to content

Commit

Permalink
support zmat based base64 encoding and decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianqian Fang committed May 2, 2019
1 parent c797bb2 commit 8360fd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base64decode.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
if(nargin==0)
error('you must provide at least 1 input');
end
if(exist('zmat')==3)
output=zmat(uint8(input),0,'base64');
return;
end
if(exist('OCTAVE_VERSION','builtin'))
len=rem(numel(input),8)
if(len)
Expand Down
4 changes: 4 additions & 0 deletions base64encode.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
if(nargin==0)
error('you must provide at least 1 input');
end
if(exist('zmat')==3)
output=zmat(uint8(input),1,'base64');
return;
end
if(exist('OCTAVE_VERSION','builtin'))
output = base64_encode(uint8(input));
return;
Expand Down

0 comments on commit 8360fd1

Please sign in to comment.