Rewritten June 2020
xcall MIAMEX, MX_HASHFILE, path, hash1, hash2, hash3, hash4
MX_HASHFILE (MIAMEX 25) returns a hash code for the file specified in the path argument. The hash code consists of four integer values.
Parameters
path (String) [in]
specification of file being hashed. May be in native or AMOS format.
hash1...4 (Num) [out]
receive the four parts of the hash. Each part if an integer from zero to 255.
Comments
The hash algorithm is the same as that used by the AMOS DIR/H command.
For display purposes, the AMOS and A-Shell hash-total formats treat the numeric values as octal.
Example
The following example illustrates the use of this function to display a hash total in the format used by DIR/H:
MAP1 HSHSTR,s,4 ! Octal string byte
MAP1 STRING'HASH,s,15 ! Display format hash-total (###-###-###-###)
xcall MIAMEX,MX_HASHFILE,THISIPATH,HASH1,HASH2,HASH3,HASH4
xcall MIAMEX,MX_OCVT,HASH1,3,OT_MEM+OT_OCT,HSHSTR
STRING'HASH = HSHSTR+"-"
xcall MIAMEX,MX_OCVT,HASH2,3,OT_MEM+OT_OCT,HSHSTR
STRING'HASH = STRING'HASH+HSHSTR+"-"
xcall MIAMEX,MX_OCVT,HASH3,3,OT_MEM+OT_OCT,HSHSTR
STRING'HASH = STRING_HASH+HSHSTR+"-"
xcall MIAMEX,MX_OCVT,HASH4,3,OT_MEM+OT_OCT,HSHSTR
STRING'HASH = STRING'HASH+HSHSTR
print STRING'HASH
See Also
• | DIGEST. |