Page 1 of 1

hashlist into variable

Posted: 22 Mar 2014 15:00
by bdeshi
How do I send hashlist() into a variable?

Re: hashlist into variable

Posted: 22 Mar 2014 15:35
by SkyFrontier
Using hash(), instead?

$a = hash("md5", "") . "<tab><curitem>"; echo $a;

-do a foreach loop here...

Re: hashlist into variable

Posted: 22 Mar 2014 15:47
by bdeshi
I know how to use hash() for each item (in fact that's what I ended up using), but still, is there any way to give hashlist a cozy home in a variable? It's so much shorter than this pseudocode to generate a ~space seperated hash-list:
foreach selected item {
$hashString = Shashstring." ".hash() ;
}

hashlist does this in a word!

Re: hashlist into variable

Posted: 22 Mar 2014 15:50
by SkyFrontier
Japanophiles may tend to keep stuff ultra-specialized, sometimes.
:biggrin:

Re: hashlist into variable

Posted: 22 Mar 2014 15:53
by bdeshi
:biggrin: :eh:

Re: hashlist into variable

Posted: 24 Mar 2014 05:30
by Enternal
@SkyFrontier Lol wut?

Anyways I tried several things and apparently no you cannot put it into a list unfortunately.

Re: hashlist into variable

Posted: 24 Mar 2014 06:35
by bdeshi
Oh well, I blame Don Corleo... I mean Don L. :P

BTW, I settled for:

Code: Select all

 $hashReport  = "" ; //init
 $allItems    = trim(<selitems>, '"') ;
 
 foreach ($thisItem, $allItems, '" "', , "!NoFileSelected") {
  $thisHash   = hash("sha256","$thisItem", 3) ;
  $hashReport = $hashReport.$thisHash.<tab> ;
  $hashReport = $hashReport.$thisItem.<crlf> ;
 } ;
 $hashReport  = trim($hashReport, <crlf>) ;
 text($hashReport, 800, , "HashList") ;
 //now $hashReport is the variable that holds hashlist lookalike text