pha, phasum, pha64sum, pha128sum, pha256sum, pha512sum - compute and check PHA message digest


 pha [-w width] <options> <parameters> [filename [...]]
 pha64sum  <options> <parameters> [filename [...]]
 pha128sum <options> <parameters> [filename [...]]
 pha256sum <options> <parameters> [filename [...]]
 pha512sum <options> <parameters> [filename [...]]


Print or check PHAlanx (Parallel Hash Alternative) checksums.

For each given filename, `pha' reads the file, computes a digest of many buffers simultaneously, and produces a combined hash of them all.

`pha' is mostly useful on large files, but it can be used for small strings and standard input as well.

When used on strings, `pha' uses a stronger (somewhat slower) hash method - that can also be used on files (per flag).

`pha' is meant for multicore/multiprocessor/multithreaded environments.


 'filename'  hash <filename>
 basic options:
 -S          single thread operation (for performance comparisons)
 --stdin     hash standard input
 -v          verbose info / extended help
 -V          show version
 -h, --help  usage help
 basic parameters:
 -s string   hash <string>
 -b size     use <size>-bytes i/o buffer (default 1MB)
 -n N        spawn N threads
 -w width    compute hash <width> bits long
 -l [name]   save output to log file (default=filename.pha)
 special options:
 -c, --check list   read PHA sums from <list> and check them
 --demo             ascertain accurate operation
 --Demo             ditto, with larger (~100MiB) files
 --DEMO             even larger (~1GiB) files
 -k                 keep demo files
 -t                 show elapsed time
 -p                 show performance estimate
 -X, --hale         stronger method
 experimental options:
 -D           dump operation info
 -d           dump benchmark info  in CSV format
 -H           header line for '-d' in CSV format
 -N M         pool of M threads
 -m size      process just <size>-bytes
 -x           less stronger (but faster) method


Without any options, `pha' emits a hint to the 'help' option.


 *.pha          file containing pha sum(s) to be checked.


 /usr/local/bin         pha's default executable path


Example 1: perform the 'demo' test suite.

 $ pha --demo
 # random/ascii...create..digest..verify..PASS
 # random/binary..create..digest..verify..PASS
 # random/mixed...create..digest..verify..PASS
 # string/ascii...ingest..digest..verify..PASS

Example 2: hash a string ("pha")

 $ pha -s pha
 51ad8a0f9b403bb3 (pha)

Example 3: hash a file.

 $ pha phatestasc.dat
 3608030c3b070931  phatestasc.dat

Example 4: hash a file with the stronger method.

 $ pha -X phatestasc.dat
 cf28ea333e6e0a12  phatestasc.dat


 TERM           The value of the TERM environment variable 
                does not affect the output of `pha'.


The following exit values are returned:

 0                      No errors of any kind.
 >0                     An error occurred.


 ENOMEM         Scant memory to allow proper operation.
 EACCES         Permission denied (POSIX.1)
                Search permission is denied for
                a component of the path prefix
                of a given <pathname>.


swet(1), vdt(1), xdf(1).


Using the alternate names (pha64sum, pha128sum, pha256sum, pha512sum) renders the '-w' option ineffective.

The stronger methodi (-X) is strongly recommended for files under 1024 bytes.

`phasum' is installed as a synonym for `pha'.

`pha' does not require `root' privileges or SUID file permissions.


`pha' can (per flag) spawn more threads than the underlying system can afford or even support.


Not all possibly harmfull/misleading/nonsensical combinations of the options are prevented nor handled in the appropriate manner, and such use possibly may (and most certainly will) cause unpredictable results.


The original and current versions of `pha' consist of code and documentation written by:

        Alexandre Botao   


        Copyright (C) 2012 Alexandre Botao


`pha' is `Free and Open Source Software' (FOSS), and is licensed under the GNU GENERAL PUBLIC LICENSE Version 3 (the "License");

You may not use `pha' except in compliance with the License. You may obtain a copy of the License at

Additionally, a copy of the License is distributed along with `pha' in a file called 'LICENSE';


 Commercial support is NOT available for `pha'.
 Suggestions and/or bug reports are very welcome.


`pha' is distributed on an ``AS IS'' basis, WITHOUT ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.