Any questions from a PROFI to a SUPER PROFI - 1. - page 6

 
sergeev:
Is GetID dynamic?

Unfortunately yes, because parameter values can be changed dynamically, the ID must change accordingly.
 

the easiest option is to convert the entire parameter list into one long string and take MD5. a shorter hash function for the string.

This will give you uniqueness and uniqueness and dynamism when parameters change.

 
Is it possible to take MD5 only from external implementation (for example, through dll) or are there variants of its implementation by means of MQL4, MQL5?
 
sergeev:

You will have uniqueness and unambiguity and dynamism when you change parameters.

There will be no uniqueness.
In general, it's been recommended to use Sha256 for a long time,
because there is an algorithm that generates passwords with specified Md5.
C-4:
Is it possible to take MD5 only from external implementation (for example, through dll) or are there variants of its implementation by means of MQL4 or MQL5?
You know... if you have nothing better to do - sure, do it in Mql.
 
C-4:
Is it possible to take MD5 only from external implementation (for example, through dll) or are there variants of its implementation by means of MQL4, MQL5?

i think you can find the algorithm on the net. here for example. or wiki

 
In general... The problem with parameters and identifier is 1:1 java hashCode / equals.
Everything will turn out as you want, only if you manage to pack all the parameters into identifier.
I.e. hashing functions will not give you what you want...
 
jartmailru:
There will be no uniqueness. In fact, it has long been recommended to switch to Sha256,
because an algorithm has been created that generates a password with a given Md5.

What do passwords have to do with it? :))) we're talking about some class identifier, which is created on the fly and is different for different parameters.

----------

And in general, C-4, I thought, if a string of parameters will be created anyway, then what's the point of this hash at all. :)

Just compare the two strings.

 
sergeev:

What does the password have to do with it? :))) we are talking about a certain class identifier, which is created on the fly and is different for different parameters.

The gist of my answer:
1) Md5 will not give a unique identifier
1.1) hashing functions cannot be used for the task
2) Md5- not fashionable
Yes, you just need a comparison. All into an array and then a binary search:-).
P.S.: And in C++ you don't even need to write code for that...
 


Уникальности не будет.
И вообще уже давно рекомендуют переходить на Sha256,
потому что создан алгоритм, генерирующий пароль с заданным Md5.

Crypto-proofing is not required to solve the problem. All that matters is to create a unique fingerprint. Unfortunately MD5 is a 128 bit hash code. There are no variable types of that length in MQL. So I'll probably implement a much simpler Adler-32 on it and make it a generator of a unique 32 bit ID number for each of the class instances.

s.w. If you can elaborate on point 1.1. Why can't it be done?

 
jartmailru:

Yes, you just need a comparison. All into an array and then a binary search :-).

Yes. In this case we can do without hash.

If this variant suits Vasily, we just put all the parameters into a string. The string will be the class identifier.

Reason: