Password library

Generate passwords for integer data.

File:
Password.lib
Version:
1.0
Author:
Marcus Johansson

Contents

Details
Sub routines


Details

This library contains some few functions for generating passwords from integer data with limited range. Save files are so over-rated :)


Subroutines

Name
Parameters
Brief description
procedure
PWD_SetFormat
fmt$
Set format for passwords.
function
PWD_GetPassword$
fileds[]
Get password.
function
PWD_GetFields[]
pwd$
Get fields from password.


Subroutine documentation

procedure PWD_SetFormat ( fmt$ )

Set the format of the expected passwords. 'fmt' should be a sequence of the two characters 'x' and 'X'. 'x' represents an integer value in the range [0..31], and 'X' an integer in the range [0..1023]. If 'fmt' is set to "XXxx", the password will represent two [0..1023] integers followed by two [0..31] integers.

Parameter
Mode
Description
fmt
In
Password format.

[ Back ]


function PWD_GetPassword$ ( fileds[] )

Return a password based on the format set with 'PWD_SetFormat'. 'fields' should contain as many integer values as there were characters in the string sent to 'PWD_SetFormat'. If any value is out of range, it will be cropped. The password uses only alpha and numeric characters. Every [0..31] element adds one character to the password, and every [0..1023] element adds two characters. The extra character at the end is a checksum to prevent password modification.

Parameter
Mode
Description
fields
In
Values

Return value
The password.

[ Back ]


function PWD_GetFields[] ( pwd$ )

Convert the password 'pwd' back into integer values and return them as an array. If the password is incorrect, according to its checksum, an empty array is returned.

Parameter
Mode
Description
pwd
In
Password.

Return value
The values.

[ Back ]


Generated with NLDoc 20140630.