hashlist into variable

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

hashlist into variable

Post by bdeshi »

How do I send hashlist() into a variable?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: hashlist into variable

Post by SkyFrontier »

Using hash(), instead?

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

-do a foreach loop here...
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: hashlist into variable

Post 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!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: hashlist into variable

Post by SkyFrontier »

Japanophiles may tend to keep stuff ultra-specialized, sometimes.
:biggrin:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: hashlist into variable

Post by bdeshi »

:biggrin: :eh:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: hashlist into variable

Post by Enternal »

@SkyFrontier Lol wut?

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

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: hashlist into variable

Post 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
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply