Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
|
Hash utility functions to produce a hash file compatible to sha256sum
as well as to produce the hash value itself for validation.
More...
Static Public Member Functions | |
static boolean | appendToFile (final String outFileName, final String hashedFile, final String hashAlgo, final byte[] hashValue) |
Append the hash signature to the text file out_file. More... | |
static byte[] | calc (final String algo, final ByteInStream source) |
Return the calculated hash value using given algo name and byte input stream. More... | |
static byte[] | calc (final String algo, final String path_or_uri, final long bytes_hashed[]) |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory. More... | |
static byte[] | calc (final String algo, final String path_or_uri, final long bytes_hashed[], final long timeoutMS) |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory. More... | |
static String | fileSuffix (final String algo) |
Return a lower-case file suffix used to store a sha256sum compatible hash signature w/o dot and w/o dashes. More... | |
Hash utility functions to produce a hash file compatible to sha256sum
as well as to produce the hash value itself for validation.
Definition at line 261 of file Cipherpack.java.
|
static |
Return a lower-case file suffix used to store a sha256sum
compatible hash signature w/o dot and w/o dashes.
Definition at line 263 of file Cipherpack.java.
|
static |
Append the hash signature to the text file out_file.
The hash signature is composed as follows
*
to denote binary processingThe hash signature is similar to sha256sum
output, but the added hash algo name upfront.
outFileName | the text file to append hash signature of hashed_file. |
hashedFile | the file of the hash signature |
hashAlgo | the hash algo name used |
hashValue | the hash value of hashed_file |
Definition at line 286 of file Cipherpack.java.
|
static |
Return the calculated hash value using given algo name and byte input stream.
algo | the hash algo name |
source | the byte input stream |
Definition at line 313 of file Cipherpack.java.
|
static |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory.
algo | the hash algo name |
path_or_uri | given path or uri, either a URI denoting a single file, a single file path or directory path for which all files (not symbolic links) are considered |
bytes_hashed | returns overall bytes hashed |
timeoutMS | in case path_or_uri refers to an URI, timeout is being used as maximum duration in milliseconds to wait for next bytes. Defaults to 20_s. |
Definition at line 327 of file Cipherpack.java.
|
static |
Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory.
This variant uses a 20_s timeout to wait for next bytes.
algo | the hash algo name |
path_or_uri | given path or uri, either a URI denoting a single file, a single file path or directory path for which all files (not symbolic links) are considered |
bytes_hashed | returns overall bytes hashed |
Definition at line 341 of file Cipherpack.java.