Advertisement

测试和训练图像哈希值

阅读量:
复制代码
    function h = hash(inp,meth) 
    % HASH - Convert an input variable into a message digest using any of 
    %        several common hash algorithms 
    % 
     
    
    inp=inp(:); 
    % convert strings and logicals into uint8 format 
    if ischar(inp) || islogical(inp) 
    inp=uint8(inp); 
    else % convert everything else into uint8 format without loss of data 
    inp=typecast(inp,'uint8'); 
    end 
    
    % verify hash method, with some syntactical forgiveness: 
    meth=upper(meth); 
    switch meth 
    case 'SHA1' 
        meth='SHA-1'; 
    case 'SHA256' 
        meth=

全部评论 (0)

还没有任何评论哟~