Difference: 0LASubrUtilComputeHash (1 vs. 4)

Revision 42017-12-04 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="FullAPIList"

.UTIL COMPUTE HASH

Line: 9 to 9
 
*     PASS         <hash value returned>      FIELD            SHARE? Y
*     PASS         <hash type>                FIELD            SHARE? N
*     PASS         <Data to hash>             FIELD            SHARE? N

Added:
>
>
* PASS <Unicode flag> FIELD SHARE? N
 * GOSUB --- .UTIL COMPUTE HASH
    • Check for errors
* IF --- .UTIL COMPUTE HASH NE
Line: 24 to 25
 
  • UC for a 128 byte readable value, upper case
  • LC for a 128 byte readable value, lower case
<Data to hash> is the string to be hashed (32k max size).
Added:
>
>
<Unicode flag> Pass UNI if you want the calculation performed on a Unicode field (optional, Release 6.0 and higher only). For compatibility with release 5, the hash calculation is performed on a RAW field. PASSing a unicode field in <Data to hash> that contains characters that cannot be transcoded to the RAW encoding will result in a runtime error. To force the calculation to be performed on the Unicode field, pass UNI for <Unicode flag>. Note that since RAW and Unicode fields have different internal structures, passing the same string with and without the <Unicode Flag> will return different hash values.
 

Comments:

Read what other users have said about this page or add your own comments.

Editorial comment: This API provides a great way to overcome the APPX 256-character key length limitation. If your desired key is a field longer than 256 (such as a server file path or a group of many fields), or if it will be longer than 256 when the primary key is appended, pass the desired key value into this subroutine and use the resulting 128-byte value as your guaranteed unique key.

Changed:
<
<
-- Al Kalter - 2016-11-07
<--/commentPlugin-->
>
>
-- Al Kalter - 2016-11-07

<--/commentPlugin-->
  -- JeanNeron - 2012-03-08 \ No newline at end of file

Revision 32017-11-21 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="FullAPIList"

.UTIL COMPUTE HASH

Line: 20 to 20
 <hash value returned> is the computed value returned. This must be passed with Share="Y" to return a value. It should be an alpha field at least 64 or 128 bytes in length, depending on the <hash type> requested (Required).

<hash type> is the type of hash value you want returned (Required):

Changed:
<
<
  • B for a 64 byte binary value
>
>
  • BIN for a 64 byte binary value
 
  • UC for a 128 byte readable value, upper case
  • LC for a 128 byte readable value, lower case
<Data to hash> is the string to be hashed (32k max size).
Line: 28 to 28
  Read what other users have said about this page or add your own comments.
Deleted:
<
<

 Editorial comment: This API provides a great way to overcome the APPX 256-character key length limitation. If your desired key is a field longer than 256 (such as a server file path or a group of many fields), or if it will be longer than 256 when the primary key is appended, pass the desired key value into this subroutine and use the resulting 128-byte value as your guaranteed unique key.

-- Al Kalter - 2016-11-07

Revision 22016-11-07 - AlKalter

Line: 1 to 1
 
META TOPICPARENT name="FullAPIList"

.UTIL COMPUTE HASH

Line: 28 to 28
  Read what other users have said about this page or add your own comments.
Changed:
<
<

<--/commentPlugin-->
>
>

Editorial comment: This API provides a great way to overcome the APPX 256-character key length limitation. If your desired key is a field longer than 256 (such as a server file path or a group of many fields), or if it will be longer than 256 when the primary key is appended, pass the desired key value into this subroutine and use the resulting 128-byte value as your guaranteed unique key.

-- Al Kalter - 2016-11-07

<--/commentPlugin-->
  -- JeanNeron - 2012-03-08 \ No newline at end of file

Revision 12016-09-12 - JeanNeron

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="FullAPIList"

.UTIL COMPUTE HASH

This subroutine computes the SHA-2 hash value for the given string. APPX 5.4.5 & higher only.


Usage:

*     PASS         <hash value returned>      FIELD            SHARE? Y
*     PASS         <hash type>                FIELD            SHARE? N
*     PASS         <Data to hash>             FIELD            SHARE? N
*     GOSUB    --- .UTIL COMPUTE HASH
      *        Check for errors
*     IF       --- .UTIL COMPUTE HASH         NE

Description:

This subroutine computes the SHA-2 hash value for the given string. The first 2 parameters are required and if any required parameters are missing, the subroutine will CANCEL.

<hash value returned> is the computed value returned. This must be passed with Share="Y" to return a value. It should be an alpha field at least 64 or 128 bytes in length, depending on the <hash type> requested (Required).

<hash type> is the type of hash value you want returned (Required):

  • B for a 64 byte binary value
  • UC for a 128 byte readable value, upper case
  • LC for a 128 byte readable value, lower case
<Data to hash> is the string to be hashed (32k max size).

Comments:

Read what other users have said about this page or add your own comments.


<--/commentPlugin-->

-- JeanNeron - 2012-03-08

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback