1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-03 15:40:05 +00:00

fix: supporting salts over 32 chars in mp_hashdataset()

This commit is contained in:
Allan Bowe
2021-07-28 23:22:43 +03:00
parent f99adf5c3e
commit 39b2e7c5f9
2 changed files with 4 additions and 6 deletions

View File

@@ -5158,8 +5158,7 @@ create table &outds (rename=(
@li mf_getvartype.sas
@param [in] libds dataset to hash
@param [in] salt= Provide a salt (could be, for instance, the name of the
dataset). Max 32 chars.
@param [in] salt= Provide a salt (could be, for instance, the dataset name)
@param [out] outds= (work.mf_hashdataset) The output dataset to create. This
will contain one column (hashkey) with one observation (a hex32.
representation of the input hash)
@@ -5194,7 +5193,7 @@ create table &outds (rename=(
%let varlist=%mf_getvarlist(&libds);
data &outds(rename=(&keyvar=hashkey) keep=&keyvar);
length &prevkeyvar &keyvar $32;
retain &prevkeyvar "&salt";
retain &prevkeyvar "%sysfunc(md5(%str(&salt)),$hex32.)";
set &libds end=&lastvar;
/* hash should include previous row */
&keyvar=put(md5(&prevkeyvar