SHA256File returns the SHA-256 digest of a file's contents as lowercase
hexadecimal, copying the file through the hash in chunks so its size does not
matter. Comes with a doc comment and table-driven tests. (closes#19)
Model: opus-5
AtomicWriteFile writes to a temporary file in the same directory, flushes it,
sets the mode and renames it over the target, so a reader never sees a
half-written file and a failure leaves the old one untouched. Comes with a doc
comment and table-driven tests. (closes#17)
Model: opus-5
FileExists reports whether a path holds a regular file and DirExists whether it
holds a directory, both answering false for anything they cannot look at.
Comes with doc comments and table-driven tests. (closes#15)
Model: opus-5
RandomHexString returns the requested number of bytes from crypto/rand as
lowercase hexadecimal, so callers reaching for a token do not end up using the
predictable math/rand instead. Comes with a doc comment and table-driven tests.
(closes#13)
Model: opus-5