Skip to content

Commit

Permalink
also match sha256
Browse files Browse the repository at this point in the history
This regex detect both the hex and alphanumeric format

This is useful because:

- Sha1 is insecure and going to be replaced by sha256 in git.
- As package maintainer we often use sha256 to verify packages.
- docker and other container engines uses sha256 for container images
  • Loading branch information
Mic92 committed Sep 24, 2018
1 parent bcb40ac commit 81f0601
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Searches are case insensitive.<br/>

- `prefix + ctrl-f` - simple *f*ile search
- `prefix + ctrl-g` - jumping over *g*it status files (best used after `git status` command)
- `prefix + alt-h` - jumping over SHA-1 hashes (best used after `git log` command)
- `prefix + alt-h` - jumping over SHA-1/SHA-256 hashes (best used after `git log` command)
- `prefix + ctrl-u` - *u*rl search (http, ftp and git urls)
- `prefix + ctrl-d` - number search (mnemonic d, as digit)
- `prefix + alt-i` - *i*p address search
Expand Down
2 changes: 1 addition & 1 deletion copycat.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set_default_stored_searches() {
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${digit_search}" "[[:digit:]]+"
fi
if stored_search_not_defined "$hash_search"; then
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${hash_search}" "\b[0-9a-f]{7,40}\b"
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${hash_search}" "\b([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{62})\b"
fi
if stored_search_not_defined "$ip_search"; then
tmux set-option -g "${COPYCAT_VAR_PREFIX}_${ip_search}" "[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}"
Expand Down

0 comments on commit 81f0601

Please sign in to comment.