[Gambas-user] Checksum for array and collection

Fabien Bodard gambas.fr at gmail.com
Thu Mar 16 09:07:04 CET 2023


Le jeu. 16 mars 2023 à 08:39, Christof Thalhofer <chrisml at deganius.de> a écrit :
>
> Hi everybody,
>
> I'm in search for a function that returns a checksum for an array or a
> collection so that I have the possibility to check if the size or
> content has changed.
>
> Any ideas?
>
> To create a checksum for a string is easy, for that I use
>
> 'Digest["sha1"](sCheckstring)'
>
> with 'Digest' from gb.openssl.
>
> But how create 'sCheckstring' which represents the content of the array?
>
> A simple approach would be to use JSON.Encode($TheArray), but I wonder
> if there are faster solutions?
I think it's the the faster,

For string array you have '.join()'

But for Collection you have to deal with gambas tools to put the datas
inline and compare them in one shot.




>
> Alles Gute
>
> Christof Thalhofer
>
> --
> Dies ist keine Signatur
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----



-- 
Fabien Bodard


More information about the User mailing list