Created
April 1, 2020 10:17
-
-
Save shreeshkhadka/85f578cd26f00bdf63ac7dd973c3ae44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program what3word; | |
{$APPTYPE CONSOLE} | |
{$R *.res} | |
uses IdHashMessageDigest, | |
System.SysUtils; | |
const | |
x: integer = 15; | |
givHash: string = '990468AF2221B86A85A866F0708AC27A'; | |
var | |
i, j, k, l, m: integer; | |
nArray: array [1 .. 15] of string; | |
input, posCombo, genHash: string; | |
pMD5: TIdHashMessageDigest5; | |
begin | |
writeln('Enter Words'); | |
for i := 1 to x do | |
begin | |
readln(input); | |
nArray[i] := input; | |
end; | |
readln; | |
for i := 1 to x do | |
begin | |
for j := 1 to x do | |
begin | |
for k := 1 to x do | |
begin | |
posCombo := nArray[i] + nArray[j] + nArray[k]; | |
pMD5 := TIdHashMessageDigest5.Create; | |
try | |
genHash := pMD5.HashStringAsHex(posCombo); | |
if (CompareStr(genHash, givHash) = 0) then | |
begin | |
writeln(posCombo); | |
writeln(genHash); | |
end; | |
finally | |
pMD5.Free; | |
end; | |
end; | |
end; | |
end; | |
readln; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yali 💯