comparison m-toolbox/classes/+utils/@prog/funchash.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function h = funchash(fcnname)
2
3 % FUNCHASH compute MD5 hash of a MATLAB m-file.
4 %
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 %
7 % DESCRIPTION: FUNCHASH compute MD5 hash of a MATLAB m-file.
8 %
9 % CALL: h = funchash(mfile_name)
10 %
11 % INPUTS: fcnname - The name of an m-file.
12 %
13 % The first file found by 'which' is hashed.
14 %
15 % OUTPUTS: h - the hash string
16 %
17 % PARAMETERS: None.
18 %
19 % EXAMPLES:
20 %
21 % >> h = funchash('ao');
22 %
23 % VERSION: $Id: funchash.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $
24 %
25 % HISTORY: 21-11-07 M Hewitson
26 % Creation.
27 %
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
30 % Get filename
31 s = which(fcnname);
32
33 % Read in file
34 mfile = textread(s,'%s','delimiter','\n','whitespace','');
35
36 % hash this
37 h = ltpda_hash(char(mfile), 'MD5');
38