Fnd_Pswd
15 shared methods.
- Fnd_Pswd_BulletEntry
- Fnd_Pswd_CustomCharacters
- Fnd_Pswd_ExcludeCharacters
- Fnd_Pswd_GeneratePassword
- Fnd_Pswd_GeneratorDialog
- Fnd_Pswd_GetValidCharacters
- Fnd_Pswd_Info
- Fnd_Pswd_Localize
- Fnd_Pswd_MaxLength
- Fnd_Pswd_MinLength
- Fnd_Pswd_Strength
- Fnd_Pswd_UseLowercase
- Fnd_Pswd_UseNumbers
- Fnd_Pswd_UseSymbols
- Fnd_Pswd_UseUppercase
Fnd_Pswd_BulletEntry
Fnd_Pswd_BulletEntry (->visible object; ->text variable)
Replaces typed characters with bullet characters for password entry.
Based on the Keystroke function example in the 4D documentation.
Requires the field's On Before Keystroke event is enabled.
| Parameter | Type | Direction | Description |
|---|---|---|---|
bulletField | Pointer | in | The displayed variable |
actualField | Pointer | in | The entered value |
Fnd_Pswd_CustomCharacters
Fnd_Pswd_CustomCharacters ({characters}) --> Text
Pass any custom characters that should be used to generate passwords.
Returns the currently specified custom characters.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inCharacters | Text | in | Custom characters to use (optional) |
Result | Text | out | The current custom characters |
Fnd_Pswd_ExcludeCharacters
Fnd_Pswd_ExcludeCharacters ({characters}) --> Text
Pass any characters that should be excluded from generate passwords.
Returns the currently specified excluded characters.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inCharacters | Text | in | Characters to exclude (optional) |
Result | Text | out | The current list of excluded characters |
Fnd_Pswd_GeneratePassword
Fnd_Pswd_GeneratePassword ({options}) --> Text
Generates a password.
With no parameter it uses the module's stored settings, as it always has.
Pass an object to generate under different settings without changing the stored ones, which is also what makes it safe to call from a worker:
Fnd_Pswd_GeneratePassword({length: 16; useSymbols: False})
Fnd_Pswd_GeneratePassword({type: Fnd_Pswd_TypePronounceable})
Fnd_Pswd_GeneratePassword({type: Fnd_Pswd_TypePIN; length: 6})
The three types: Fnd_Pswd_TypeRandom - characters drawn from the classes in use Fnd_Pswd_TypePronounceable - syllables, in the shape macOS offers; see Fnd_Pswd_Pronounceable for the exact form Fnd_Pswd_TypePIN - digits only, and the exclusion list does not apply, so all ten are available
A random password holds at least one character from every class in use, so asking for numbers means getting one. Set requireEachClass to False for the older behaviour of drawing every character from the pooled set.
| Parameter | Type | Direction | Description |
|---|---|---|---|
options | Variant | in | Settings to override for this call (optional) |
Result | Text | out | The generated password |
Fnd_Pswd_GeneratorDialog
Fnd_Pswd_GeneratorDialog --> Text
Displays a password generator dialog.
| Parameter | Type | Direction | Description |
|---|---|---|---|
Result | Text | out | The generated password, or "" if cancelled |
Fnd_Pswd_GetValidCharacters
Fnd_Pswd_GetValidCharacters ({options}) --> Text
Returns a string with all of the allowed password characters (based on the user's preference settings).
Pass an object to answer for settings other than the stored ones, without changing them:
Fnd_Pswd_GetValidCharacters({useSymbols: False; excludedCharacters: "0O"})
| Parameter | Type | Direction | Description |
|---|---|---|---|
options | Variant | in | Settings to override for this call (optional) |
Result | Text | out | A string of all valid characters |
Fnd_Pswd_Info
Fnd_Pswd_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired ("version" or "name") |
Result | Text | out | Response |
Fnd_Pswd_Localize
Fnd_Pswd_Localize
Passed the localization strings to the General and (if available) Localization components.
No parameters.
Fnd_Pswd_MaxLength
Fnd_Pswd_MaxLength ({max chars to use{; max limitation}}) --> Number
Allows the developer to set the maximum password length, and optionally the maximum password length defined in the Generator dialog. Returns the current value of the maximum password length.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inMaxChars | Longint | in | The maximum password length setting (optional) |
inMaxLimitation | Longint | in | The maximum value displayed in the pop-up menu (optional) |
Result | Longint | out | The currently set maximum length |
Fnd_Pswd_MinLength
Fnd_Pswd_MinLength ({min chars to use{; min limitation}}) --> Number
Allows the developer to set the Minimum password length, and optionally the Minimum password length defined in the Generator dialog. Returns the current value of the Minimum password length.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inMinChars | Longint | in | The Minimum password length setting (optional) |
inMinLimitation | Longint | in | The Minimum value displayed in the pop-up menu (optional) |
Result | Longint | out | The currently set Minimum length |
Fnd_Pswd_Strength
Fnd_Pswd_Strength ($password_t : Text {; $options_v : Variant}) --> Object
How much work guessing the password would be, given only its length and the character classes it draws on.
$strength_o:=Fnd_Pswd_Strength("Tr0ub4dor&3")
$strength_o.bits --> 72.1
$strength_o.rating --> 3
rating runs 0 to 4 — very weak, weak, reasonable, strong, very strong — at the customary boundaries of 28, 36, 60 and 128 bits. Pass rating through Fnd_Gen_GetString("Fnd_Pswd"; "Strength"+String(rating)) for a localized name.
By default this counts the pool a guesser would have to search, which is an upper bound rather than a judgement: it cannot know a password is a dictionary word, and it badly overstates a pronounceable one, whose syllables are far more constrained than its letters suggest.
So tell it what it is looking at when you know:
Fnd_Pswd_Strength($password_t; {type: Fnd_Pswd_TypePronounceable})
which counts the passwords that shape can actually produce instead — about 79 bits for the three-group default, against the 131 its characters imply.
| Parameter | Type | Direction | Description |
|---|---|---|---|
password | Text | in | The password to weigh |
options | Variant | in | { type } — how it was generated, if known (optional) |
Result | Object | out | { length ; poolSize ; bits ; rating } |
Fnd_Pswd_UseLowercase
Fnd_Pswd_UseLowercase ({use Lowercase?}) --> Boolean
Pass True to tell the password generator to use lowercase letters in passwords.
Returns the current setting.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inLowercase | Boolean | in | True to use lowercase letters (optional) |
Result | Boolean | out | True if lowercase letters can be used |
Fnd_Pswd_UseNumbers
Fnd_Pswd_UseNumbers ({use numbers?}) --> Boolean
Pass True to tell the password generator to use numbers in passwords.
Returns the current setting.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inNumbers | Boolean | in | True to use numbers (optional) |
Result | Boolean | out | True if numbers can be used |
Fnd_Pswd_UseSymbols
Fnd_Pswd_UseSymbols ({use symbols?}) --> Boolean
Pass True to tell the password generator to use symbols in passwords.
Returns the current setting.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inSymbols | Boolean | in | True to use symbols (optional) |
Result | Boolean | out | True if symbols can be used |
Fnd_Pswd_UseUppercase
Fnd_Pswd_UseUppercase ({use uppercase?}) --> Boolean
Pass True to tell the password generator to use uppercase letters in passwords.
Returns the current setting.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inUppercase | Boolean | in | True to use uppercase letters (optional) |
Result | Boolean | out | True if uppercase letters can be used |