checksumLine.php
Table of Contents
Functions
- checksumLine() : string
- Writes the line that records a file's checksum, as `sha256sum` writes it.
Functions
checksumLine()
Writes the line that records a file's checksum, as `sha256sum` writes it.
checksumLine(string $hash, string $filename) : string
The hash in lowercase, two spaces, the file name, a line feed: sha256sum -c (or md5sum -c,
shasum -c…) checks it by hand, beside the file, without PHP. Give the name alone, with no
directory, and the line still checks once both files are copied elsewhere.
sha256sum writes a name holding a line feed or a backslash another way (escaped, with a
backslash before the line): such a name is not supported here.
Parameters
- $hash : string
-
The checksum, hexadecimal, e.g. from fileChecksum().
- $filename : string
-
The name of the file.
Tags
Return values
string —The line, ending with a line feed.