Skip to content

Instantly share code, notes, and snippets.

@shreeshkhadka
Created April 1, 2020 10:17
Show Gist options
  • Save shreeshkhadka/85f578cd26f00bdf63ac7dd973c3ae44 to your computer and use it in GitHub Desktop.
Save shreeshkhadka/85f578cd26f00bdf63ac7dd973c3ae44 to your computer and use it in GitHub Desktop.
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.
@Magnus167
Copy link

Magnus167 commented Apr 2, 2020

yali 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment