buymeasoda RefDocs
  • Overview
  • General
    • Android
    • Apache
    • Fish
    • Git
    • Github
    • Gmail
    • Homebrew
    • iOS
    • iTerm
    • MacOS
    • MacPorts
    • Mamp
    • Media
    • Mercurial
    • MySQL
    • Node
    • npm
    • nvm
    • Obsidian
    • PHP
    • React Native
    • Rust
    • Server
    • Slack
    • Sourcegraph
    • Tools
    • Vim
    • VS Code
    • Yarn
  • Unix
    • Checksum and hash utilities
    • Command line history
    • Command line keyboard shortcuts
    • Compress files and folders
    • Crontab
    • Diff files and folders
    • Disk usage and file sizes
    • Find and search files
    • Firewall configuration
    • Help and manual pages
    • HostName and Local HostName for Mac OSX
    • Navigating the file system
    • Network, domains and routing
    • Run and manage background tasks
    • Secure FTP SFTP and Secure Copy SCP
    • Secure Shell SSH
    • Sync files and folders
    • System and process management
    • System and user information
    • Useful characters
    • Useful commands
    • User, file and group permissions
    • Working with cURL
    • Working with files and directories
    • Working with text
Powered by GitBook
On this page
  • Checksum tools
  • Cyclic redundancy tools
  • Securely generate a hash locally from text input
  1. Unix

Checksum and hash utilities

Checksum tools

MD5 (Message digest algorithm)

md5

SHA 1/256/512 (Secure hash Algorithm)

shasum
shasum -a 256
shasum -a 512

File usage

md5 <file>
shasum <file>
cat <file> | md5
cat <file> | shasum

String input usage

echo <string> | md5
echo <string> | shasum

Cyclic redundancy tools

CRC (Cyclic redundancy check)

crc32 <file>

Securely generate a hash locally from text input

  • Allows using command line to generate hash without logging input to shell history

  • Replace shasum with any of the checksum variants to generate the required hash

Bash version

read -sp 'Input: ' input; echo; echo -n 'Output: '; echo -n "$input" | shasum; unset input

Fish version

read -sP 'Input: ' input; echo -n 'Output: '; echo -n "$input" | shasum; set -e input
PreviousYarnNextCommand line history

Last updated 3 years ago