BookmarkSubscribeRSS Feed

The main limitation with the SAS MD5 hash function (and SHA256) is the 32K data length limit.  This doesn’t allow the creation of a hash for, say, a large file which is consistent with externally MD5 generated hashes, although an internally usable hash is easy enough to generate with chaining.

 

I am suggesting an extension to the hashing functions that saves the internal state between calls and resumes the hash process with further data.

 

For example:

 

* running hash of 'part1', initalise state ;

hash = md5('part1',internal_state_id1,'i');

 

* running hash of 'part1part2' ;

hash = md5('part2',internal_state_id1);

 

* final hash value of 'part1part2part3' ;

hash = md5('part3',internal_state_id1);

2 Comments
BrunoMueller
SAS Super FREQ

Have a look at the new HASHING_FILE function available with SAS9.4M6, it allows you do exactly this.

Greg-B
Fluorite | Level 6

Thanks Bruno, I thought I had read up 'what's new' in M6.  Yes, it is even better than what I'd wanted.