News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

How to generate md5_value and sha1_value

Started by mossity, 04.07.2016 10:25:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mossity

Hi,

I'm using jD 3.2 on Joomla 3.5.1.
I have written a script to import downloads from am old site to a new site. I see that the system generates md5_value and sha1_value when adding a document through the Joomla JD administrator.

How are these values generated and what are they used for? Do I need them?
I checked the extension source code and could find the code where the functions are called but can't seem to get them.
Seems to use the files path but when I try to generate the values, they are not the same as the Joomla JD generated values.



If the values are important, I would like to generate them from my import script and just need to know.
  •  

ColinM

Hi
The md5 and sha1 values are essentially 'checksums' formed from a source file by specific standard algorithms.  They are not intrinsically 'important' so they could be left blank.  Their purpose is to allow a user to compute the values on the downloaded files so that there is some guarantee of accuracy. Would only be used normally on encrypted,  machine readable, image, audio or video files where one bad byte can make the whole useless.

PHP has an md5_file function  http://www.w3schools.com/php/func_string_md5_file.asp
and of course the corresponding sha1_file function  http://www.w3schools.com/php/func_string_sha1_file.asp

There are also javascript versions.

There are numerous web sites that offer the ability to calculate these values

One of the aspects of doing your own import script is also setting the Joomla! assets, which are basically the permissions and the view access.  Usually one just needs to set the permissions on the top level categories and they will cascade down. BUT to get the 'cascading' one needs to do a Save on the Permissions.  One other way is to use the Permissions Tools in the jD Toolbox to reset them.  Also if they are 'missing' then it may be worth while paying for the ACL Manager which has a diagnostic to fix missing assets.

If you come across 'problems' please ask - will try to help.

Colin
Colin M
  •