Skip to content

SHA1 Utilities

Usage

trim_sha(sha)

is_sha(sha)

Arguments

sha

Character. The commit SHA-1 hash to pull messages from. If NULL, the most recent commit on the current branch.

Value

trim_sha(): Character. The trimmed sha. If sha is not a SHA1 hash, the identical string unchanged.

is_sha(): Logical. If sha matches the SHA1 expected pattern.

Functions

  • trim_sha(): trims the SHA-1 hash from the default full length to the human-readable short version.

  • is_sha(): determines whether strings to be tested are a SHA1 hash via regular expression ("^[a-f0-9]{5,40}$") match.

See also