1 Star 0 Fork 0

淘金小子/jsonlab

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github/workflows
examples
images
test
.gitignore
.miss_hit
.travis.yml
AUTHORS.txt
ChangeLog.txt
Contents.m
DESCRIPTION
INDEX
LICENSE_BSD.txt
LICENSE_GPLv3.txt
README.rst
base64decode.m
base64encode.m
blosc2decode.m
blosc2encode.m
decodevarname.m
encodevarname.m
fast_match_bracket.m
filterjsonmmap.m
gendocs.sh
genlog.sh
getfromjsonpath.m
gzipdecode.m
gzipencode.m
isoctavemesh.m
jdatadecode.m
jdataencode.m
jdatahash.m
jload.m
jsave.m
jsonget.m
jsonlab.prj
jsonopt.m
jsonset.m
loadbj.m
loadjd.m
loadjson.m
loadmsgpack.m
loadubjson.m
lz4decode.m
lz4encode.m
lz4hcdecode.m
lz4hcencode.m
lzipdecode.m
lzipencode.m
lzmadecode.m
lzmaencode.m
match_bracket.m
mergestruct.m
nestbracket2dim.m
octavezmat.m
package.json
savebj.m
savejd.m
savejson.m
savemsgpack.m
saveubjson.m
varargin2struct.m
zlibdecode.m
zlibencode.m
zstddecode.m
zstdencode.m
克隆/下载
base64decode.m 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
function output = base64decode(varargin)
%
% output = base64decode(input)
%
% Decoding a Base64-encoded byte-stream to recover the original data
% This function depends on JVM in MATLAB or, can optionally use the ZMat
% toolbox (http://github.com/NeuroJSON/zmat)
%
% Copyright (c) 2012, Kota Yamaguchi
% URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
%
% Modified by: Qianqian Fang (q.fang <at> neu.edu)
%
% input:
% input: a base64-encoded string
%
% output:
% output: the decoded binary byte-stream as a uint8 vector
%
% examples:
% bytes=base64encode('Test JSONLab');
% orig=char(base64decode(bytes))
%
% license:
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
%
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
%
if (nargin == 0)
error('you must provide at least 1 input');
end
if (exist('zmat', 'file') == 2 || exist('zmat', 'file') == 3)
output = zmat(varargin{1}, 0, 'base64');
return
elseif (isoctavemesh)
error('You must install the ZMat toolbox (http://github.com/NeuroJSON/zmat) to use this function in Octave');
end
error(javachk('jvm'));
if (ischar(varargin{1}))
varargin{1} = uint8(varargin{1});
end
input = typecast(varargin{1}(:)', 'uint8');
output = typecast(org.apache.commons.codec.binary.Base64.decodeBase64(input), 'uint8')';
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quehanwei/jsonlab.git
git@gitee.com:quehanwei/jsonlab.git
quehanwei
jsonlab
jsonlab
master

搜索帮助