Documentation

crypt

These are a collection of functions for using, managing, and creating encrypted or generated data.

Configurable Fields

These fields are filled out when the system is installed, but can be changed at any time.
It should be remembered that the system manages two types of database users. One has full permissions and is only used by system administration accounts. The remaining accounts use restricted permissions.

arr_ENCODINGCHARS
These are the alphanumeric values ​​that will be used to generate encrypted values.
This string can be altered by moving or deleting some of them. Once defined, it should not be altered.

Functions

newID

Returns a 32-character alphanumeric ID (defined by arr_ENCODINGCHARS) unless another value is specified as a parameter. This alphanumeric string is based on the IP (note that the envGet(ip) function is not used for this purpose) and a random sequence. Note that direct generation is not used to avoid potential conflicts with concurrent access.

generateIID

Returns a 22-character alphanumeric ID, generated from the parameter sent, usually a 32-character one, and can be an ID. The values ​​from arr_ENCODINGCHARS are also used.

key8m

Generates an array of two time-based values. The first is based on the current number of seconds (time), while the second is based on the previous 8'32". You can (and recommend) specify a seed key.

validateKey8m

Validates based on the seed key and the received token, if it matches the possible values ​​generated by the previous function.

key18h

Similar to key8m, but for a time period of 18h 12'

validateKey18h

Similar to validateKey18h, but validates keys generated with key18h

encodePwd

Receives as parameters the string to encode and the security value to use, returning the encoded password.

sessionValue

Generates a random-length value that is used as a session identifier. Using the key18h encoding system.

encodeBase64TabbedData

Receives an array of unspecified length, concatenating the values ​​as a tab-separated string, and then converting it to Base64.

decodeBase64TabbedData

Function that performs the reverse of the above. It takes a Base64 string and returns an array.

Search