Class Details

Class ahpwcheck
Version 1.2.

ahpwcheck(aOptions)
<script>
var oPwCheck = new ahpwcheck(aOptions);
alert(oPwCheck.getScore('My:0815;Password');
</script>
Parameters:
{object} aOptions
- options to override checks, texts or weights for scoring (optional)
Returns:
none

Field Details

aChecks
individual checks, you can override "required" option with method setOptions in the options array create a key 'checks'
aLang
language specific texts; you can override them with method setOptions in the options array create a key 'lang'

Public Methods

checkPw

{undefined} checkPw()

re-read watched input field and update visual output; this function will be added as handler to the password field

Returns:
{undefined}

getChecks

{object} getChecks()

get object with results containing all single checks and total result with scoring

Returns:
{object}

getResult

{object} getResult(sPassword)

get object with results containing all single checks and total result with scoring

Parameters:
{string} sPassword
Returns:
{object}

getScore

{object} getScore(sPassword)

get scoring (a avalue 0..1); It says how many requirements were fulfilled in a given password. It depends on the number of checks, their required count and the weight for each check. (It is NOT the measurement for the real strength of a given password.)

Parameters:
{string} sPassword
Returns:
{object}

renderAll

{undefined} renderAll()

ouput all: put introtext and all checks into the output div

Returns:
{undefined}

renderChecks

{string} renderChecks()

get html code to render all reqired single checks

Returns:
{string}

renderIntro

{string} renderIntro()

get html code to render intro text

Returns:
{string}

setOptions

setOptions(aOptions)

set options - override texts - change requirements for single checks - change weights for scoring

Parameters:
aOptions

watch

{Boolean} watch(sIdInput, sIdOut)

watch - init for visual display in html body; it adds the method checkPw() to eventlisters of the password field and starts the output

Parameters:
{string} sIdInput
id of input field where the user enters a new password
{string} sIdOut
id of a div for output
Returns:
{Boolean}

Documentation was generated by JsDoc Toolkit 2.4.0






Copyright © 2024 Axel Hahn
project page: GitHub (en)
results will be here