Create passwords of different lengths

75 views
Skip to first unread message

Aly IGERY

unread,
Jan 16, 2026, 6:43:42 AM (3 days ago) Jan 16
to mementodatabase
Hey guys, we need your help again!

We have a Memento database called "Passwords".

This database has, among other things, two fields:

One field named [Password] in text format and a button field (trigger) named [Generate]. When we click the [Generate] button, it should insert random characters of a different length into the [Password] field.

I happened to find some code for this, but it's in PascalScript, to rename files of a specific length with a file extension. Could someone please convert this code to JavaScript? The function for the file extension needs to be removed.

Thanks in advance!
................... PascalScript ......................
const
  CHARS = 'abcdefghklmnopqrstuvwxyzABCDEFGHKLMNOPQRSTUVWXYZ';
  LENGTH_MIN = 25;
  LENGTH_MAX = 80;
  LENGTH_EXT = 0;
var
  I, CharIndex, BaseLength, FullLength. Integer;
  Initialized. Boolean;
begin
  if not Initialized then
  begin
    Initialized .= True;  
    Randomize;
  end;
  BaseLength .= RandomRange(LENGTH_MIN, LENGTH_MAX + 1);
  FullLength .= BaseLength + LENGTH_EXT + 1;
  SetLength(FileName, FullLength);
  for I .= 1 to FullLength do
  begin
    CharIndex .= RandomRange(1, Length(CHARS) + 1);
    FileName[I] .= CHARS[CharIndex];
  end;
  FileName[BaseLength + 1] .= '.';
end.

Mmm

unread,
Jan 16, 2026, 8:20:52 AM (2 days ago) Jan 16
to mementodatabase
Вариант другого решения из открытых источников. 
Шаблон с примером:

пятница, 16 января 2026 г. в 14:43:42 UTC+3, warna...@gmail.com:
Scr_2.png
Message has been deleted

Mmm

unread,
Jan 16, 2026, 9:37:57 AM (2 days ago) Jan 16
to mementodatabase
В сообщении указана ссылка на каталог шаблонов MDB.
Шаблон доступен для поиска и загрузки.

пятница, 16 января 2026 г. в 16:20:52 UTC+3, Mmm:
Scr_3.png

Aly IGERY

unread,
Jan 16, 2026, 9:44:16 AM (2 days ago) Jan 16
to mementodatabase
👍👍👍 … works perfectly. Thank you very much 👏👏👏👏

Mmm

unread,
3:49 AM (16 hours ago) 3:49 AM
to mementodatabase
Доработанный вариант с выбором групп символов в новом пароле.

Шаблон в каталоге шаблонов MDB:
пятница, 16 января 2026 г. в 17:44:16 UTC+3, warna...@gmail.com:
Scr_4.png
Reply all
Reply to author
Forward
0 new messages