文件名称:DataHash
介绍说明--下载内容均来自于网络,请自行研究使用
官方哈希加密算法
% EXAMPLES:
% % Default: MD5, hex:
% DataHash([]) % 5b302b7b2099a97ba2a276640a192485
% % MD5, Base64:
% Opt = struct('Format', 'base64', 'Method', 'MD5');
% DataHash(int32(1:10), Opt) % +tJN9yeF89h3jOFNN55XLg
% % SHA-1, Base64:
% S.a = uint8([]);
% S.b = {{1:10}, struct('q', uint64(415))};
% Opt.Method = 'SHA-1';
% Opt.Format = 'HEX';
% DataHash(S, Opt) % 18672BE876463B25214CA9241B3C79CC926F3093
% % SHA-1 of binary values:
% Opt = struct('Method', 'SHA-1', 'Input', 'bin');
% DataHash(1:8, Opt) % 826cf9d3a5d74bbe415e97d4cecf03f445f69225
% % SHA-256, consider ASCII part only (Matlab's CHAR has 16 bits!):
% Opt.Method = 'SHA-256';
% Opt.Input = 'ascii';
% DataHash('abc', Opt)
% % ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
% % Or equivalently:
% Opt.Input = 'bin';
% DataHash(uint8('abc'), Opt)(Official hash encryption algorithm
% EXAMPLES:
% % Default: MD5, hex:
% DataHash([]) % 5b302b7b2099a97ba2a276640a192485
% % MD5, Base64:
% Opt = struct('Format', 'base64', 'Method', 'MD5');
% DataHash(int32(1:10), Opt) % +tJN9yeF89h3jOFNN55XLg
% % SHA-1, Base64:
% S.a = uint8([]);
% S.b = {{1:10}, struct('q', uint64(415))};
% Opt.Method = 'SHA-1';
% Opt.Format = 'HEX';
% DataHash(S, Opt) % 18672BE876463B25214CA9241B3C79CC926F3093
% % SHA-1 of binary values:
% Opt = struct('Method', 'SHA-1', 'Input', 'bin');
% DataHash(1:8, Opt) % 826cf9d3a5d74bbe415e97d4cecf03f445f69225
% % SHA-256, consider ASCII part only (Matlab's CHAR has 16 bits!):
% Opt.Method = 'SHA-256';
% Opt.Input = 'ascii';
% DataHash('abc', Opt)
% % ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
% % Or equivalently:
% Opt.Input = 'bin';
% DataHash(uint8('abc'), Opt))
% EXAMPLES:
% % Default: MD5, hex:
% DataHash([]) % 5b302b7b2099a97ba2a276640a192485
% % MD5, Base64:
% Opt = struct('Format', 'base64', 'Method', 'MD5');
% DataHash(int32(1:10), Opt) % +tJN9yeF89h3jOFNN55XLg
% % SHA-1, Base64:
% S.a = uint8([]);
% S.b = {{1:10}, struct('q', uint64(415))};
% Opt.Method = 'SHA-1';
% Opt.Format = 'HEX';
% DataHash(S, Opt) % 18672BE876463B25214CA9241B3C79CC926F3093
% % SHA-1 of binary values:
% Opt = struct('Method', 'SHA-1', 'Input', 'bin');
% DataHash(1:8, Opt) % 826cf9d3a5d74bbe415e97d4cecf03f445f69225
% % SHA-256, consider ASCII part only (Matlab's CHAR has 16 bits!):
% Opt.Method = 'SHA-256';
% Opt.Input = 'ascii';
% DataHash('abc', Opt)
% % ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
% % Or equivalently:
% Opt.Input = 'bin';
% DataHash(uint8('abc'), Opt)(Official hash encryption algorithm
% EXAMPLES:
% % Default: MD5, hex:
% DataHash([]) % 5b302b7b2099a97ba2a276640a192485
% % MD5, Base64:
% Opt = struct('Format', 'base64', 'Method', 'MD5');
% DataHash(int32(1:10), Opt) % +tJN9yeF89h3jOFNN55XLg
% % SHA-1, Base64:
% S.a = uint8([]);
% S.b = {{1:10}, struct('q', uint64(415))};
% Opt.Method = 'SHA-1';
% Opt.Format = 'HEX';
% DataHash(S, Opt) % 18672BE876463B25214CA9241B3C79CC926F3093
% % SHA-1 of binary values:
% Opt = struct('Method', 'SHA-1', 'Input', 'bin');
% DataHash(1:8, Opt) % 826cf9d3a5d74bbe415e97d4cecf03f445f69225
% % SHA-256, consider ASCII part only (Matlab's CHAR has 16 bits!):
% Opt.Method = 'SHA-256';
% Opt.Input = 'ascii';
% DataHash('abc', Opt)
% % ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
% % Or equivalently:
% Opt.Input = 'bin';
% DataHash(uint8('abc'), Opt))
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
DataHash.m | 19187 | 2016-06-18 |