Namespace Jek.algorithm
Defined in: JekFk.js.
Method Summary
levenshteinDistance(string1, string2)
The Levenshtein distance is a metric for measuring the amount of difference between two strings, is the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character.
stringDistancePerc(str1, str2, decimalPositions[optional])
generatePassword(str, seed, pswLen)
Generate a password from string (like Name + Surname) based on a passed seed
Method Detail
Jek.algorithm.md5(string)
Calculate the md5 hash of a string.
Defined in: Jek.algorithm.md5.js.
Parameters:
{String} | string |
Jek.algorithm.passwordComplexity(pwd)
Calculate the password complexity
Defined in: Jek.algorithm.passwordComplexity.js.
Parameters:
{String} | pwd | password |
Jek.algorithm.sha1(string)
Calculate the sha1 hash of a string.
Defined in: Jek.algorithm.sha1.js.
Parameters:
{String} | string |
Jek.algorithm.crc32(string)
: String
Jek.algorithm.crc32
Parameters:
{String} | string |
Returns:
{String} |
Jek.algorithm.levenshteinDistance(string1, string2)
: Number
The Levenshtein distance is a metric for measuring the amount of difference
between two strings, is the minimum number of edits needed to transform one
string into the other, with the allowable edit operations being insertion,
deletion, or substitution of a single character.
Parameters:
{String} | string1 | |
{String} | string2 |
Returns:
{Number} |
Jek.algorithm.stringDistancePerc(str1, str2, decimalPositions[optional])
: Number
Parameters:
{String} | str1 | |
{String} | str2 | |
{Number} | decimalPositions[optional] | default value = 0 |
Returns:
{Number} |
Jek.algorithm.charSequenceCheck(str)
: Number
Check if a string contains a sequence of characters or numbers
Example:
Example: 12345, abcdef, 876543210, 123bcde, 12344321, etc.
Parameters:
{String} | str |
Returns:
{Number} |
Jek.algorithm.generatePassword(str, seed, pswLen)
: String
Generate a password from string (like Name + Surname) based on a passed seed
Parameters:
{String} | str | |
{String} | seed | |
{Number} | pswLen |
Returns:
{String} |
Jek.algorithm.dv1(str, len)
: String
Calculate the dv1 hash of a string.
Parameters:
{String} | str | |
{Number} | len |
Returns:
{String} |