Skip to content

Commit 8360fd1

Browse files
author
Qianqian Fang
committed
support zmat based base64 encoding and decoding
1 parent c797bb2 commit 8360fd1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

base64decode.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
if(nargin==0)
1818
error('you must provide at least 1 input');
1919
end
20+
if(exist('zmat')==3)
21+
output=zmat(uint8(input),0,'base64');
22+
return;
23+
end
2024
if(exist('OCTAVE_VERSION','builtin'))
2125
len=rem(numel(input),8)
2226
if(len)

base64encode.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
if(nargin==0)
1818
error('you must provide at least 1 input');
1919
end
20+
if(exist('zmat')==3)
21+
output=zmat(uint8(input),1,'base64');
22+
return;
23+
end
2024
if(exist('OCTAVE_VERSION','builtin'))
2125
output = base64_encode(uint8(input));
2226
return;

0 commit comments

Comments
 (0)