Forum: Programmieren allgemein
Delphi
by Kas Ob.,
28. Jan 2024
Here this is the smallest workaround the problem for this case like what OP presented.
the modification are only in DECHashAuthentication.pas
function ValidAuthHash(HashClass: TDECHashClass): TDECHashAuthenticationClass;
procedure SetDefaultAuthHashClass(HashClass: TDECHashClass);
implementation
uses
DECUtil;
Forum: Programmieren allgemein
Delphi
by Kas Ob.,
28. Jan 2024
I see this discrepancy in the implementation
// in DECHash.pas
THashBaseMD4 = class(TDECHashAuthentication)
THash_SHA0 = class(THashBaseMD4)
THash_SHA256 = class(THash_SHA0)
// while in DECHashAuthentication.pas
TDECHashAuthentication = class(TDECHash)
Forum: Programmieren allgemein
Delphi
by Kas Ob.,
28. Jan 2024
Yes, it is tricky to add IDECHashAuthentication because the class methods, and to solve this either add the same naming methods in TDECHash, so you can redirect all these methods to the class ones in TDECHashAuthentication, or introduce new global function ValidPasswordHash just like ValidHash that return TDECHashAuthentication.
Both approaches are not ideals, the best or the better is MAY BE...
Forum: Programmieren allgemein
Delphi
by Kas Ob.,
27. Jan 2024
I am really sorry, but i don't even have an account on GitHub !
Forum: Programmieren allgemein
Delphi
by Kas Ob.,
26. Jan 2024
I looked at the library,
ValidFormat and ValidHash supposed to be working as factory design, you feed them a class type and will get a class, this implementation to remove the need to hardcode a switch between algorithms.
https://en.wikipedia.org/wiki/Factory_method_pattern
but with simple function instead of a class.