| Crates.io | shad3 |
| lib.rs | shad3 |
| version | 1.1.51 |
| created_at | 2024-08-24 04:21:49.580119+00 |
| updated_at | 2024-10-30 18:32:49.594483+00 |
| description | App for hashing entries in blocklists |
| homepage | https://github.com/styromaniac/shad3 |
| repository | https://github.com/styromaniac/shad3 |
| max_upload_size | |
| id | 1349802 |
| size | 1,086,808 |
SHAD3 is an application using SHA3-512 to hash entries in a list or multiple lists, typically those made for Pi-hole. This is designed for SHATTER and similar applications or addons. Ideally, it serves to maintain the confidentiality of blocked content, which may include exploitative or abusive websites.
shad3 <blocklist-url-or-path> [output-path]
Pre-built binaries are available in the releases section. The following one-liners automatically detect the CPU architecture and download the correct binary:
ARCH=$(uname -m) && case $ARCH in 'x86_64') BIN=shad3-linux_x86_64.tar.gz ;; 'aarch64') BIN=shad3-linux_aarch64.tar.gz ;; *) echo "Unsupported architecture: $ARCH" && exit 1 ;; esac && curl -LO https://github.com/styromaniac/shad3/releases/latest/download/$BIN && tar -xzf $BIN && chmod +x shad3 && sudo mv shad3 /usr/local/bin && rm -rf $BIN
ARCH=$(uname -m) && case $ARCH in 'x86_64') BIN=shad3-macos_x86_64.tar.gz ;; 'aarch64') BIN=shad3-macos_aarch64.tar.gz ;; *) echo "Unsupported architecture: $ARCH" && exit 1 ;; esac && curl -LO https://github.com/styromaniac/shad3/releases/latest/download/$BIN && tar -xzf $BIN && chmod +x shad3 && sudo mv shad3 /usr/local/bin && rm -rf $BIN
$ARCH = (Get-WmiObject Win32_Processor).Architecture
if ($ARCH -eq 9) {
$BIN = 'shad3-windows_x86_64.zip'
} elseif ($ARCH -eq 5) {
$BIN = 'shad3-windows_aarch64.zip'
} else {
Write-Host "Unsupported architecture: $ARCH" -ForegroundColor Red
exit
}
Invoke-WebRequest -Uri "https://github.com/styromaniac/shad3/releases/latest/download/$BIN" -OutFile $BIN
Expand-Archive -Path $BIN -DestinationPath .
Move-Item -Path .\shad3.exe -Destination "$env:ProgramFiles\shad3.exe"
Remove-Item -Recurse -Force $BIN
ARCH=$(uname -m) && case $ARCH in 'x86_64') BIN=shad3-termux_x86_64.zip ;; 'aarch64') BIN=shad3-termux_aarch64.zip ;; *) echo "Unsupported architecture: $ARCH" && exit 1 ;; esac && curl -LO https://github.com/styromaniac/shad3/releases/latest/download/$BIN && unzip $BIN && chmod +x shad3 && mv shad3 ~/../usr/bin && rm -rf $BIN
These one-liners download, build using Cargo, install, and clean up for each environment. They utilize Rust utilities and commands (cargo) where applicable, and account for Linux package managers. For Termux, rustup is avoided by using pkg to install Rust.
# Detect package manager and install Rust
if command -v apt &> /dev/null; then
sudo apt update && sudo apt install -y build-essential curl git cargo
elif command -v dnf &> /dev/null; then
sudo dnf install -y @development-tools curl git cargo
elif command -v pacman &> /dev/null; then
sudo pacman -Syu --noconfirm base-devel curl git cargo
else
echo "Unsupported package manager. Please install Rust and Cargo manually."
exit 1
fi && # Install SHAD3 using Cargo
cargo install shad3 && # Ensure Cargo bin directory is in PATH
export PATH="$HOME/.cargo/bin:$PATH" && # Optionally move the binary to a system-wide location
sudo cp ~/.cargo/bin/shad3 /usr/local/bin/
# Install Homebrew if not installed
if ! command -v brew &> /dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi && # Install Rust and Cargo using Homebrew
brew install rust && # Install SHAD3 using Cargo
cargo install shad3 && # Ensure Cargo bin directory is in PATH
export PATH="$HOME/.cargo/bin:$PATH" && # Optionally move the binary to a system-wide location
sudo cp ~/.cargo/bin/shad3 /usr/local/bin/
# Install Rust using Cargo via Chocolatey
if (-not (Get-Command choco -ErrorAction SilentlyContinue)) {
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
}
choco install -y rustup.install && refreshenv && rustup default stable && # Install SHAD3 using Cargo
cargo install shad3 && # Move the binary to a system-wide location
Move-Item -Path "$env:USERPROFILE\.cargoin\shad3.exe" -Destination "$env:ProgramFiles\shad3.exe"
# Update packages and install Rust via pkg (avoiding rustup)
pkg update && pkg install -y rust git unzip && # Install SHAD3 using Cargo
cargo install shad3 && # Move the binary to a system-wide location
mv ~/.cargo/bin/shad3 ~/../usr/bin
After installation, verify with:
shad3
You should see the usage information for SHAD3, confirming a successful installation.
SHAD3 is compatible with the following:
If you encounter any issues during installation or use, please check:
curl, tar, and sudo are installed.curl, tar, unzip, and rust are installed via pkg.PATH if using a direct download or Cargo installation.cargo or the Rust toolchain.rustup is not available, Rust is installed via the package manager (pkg), and the environment is set up accordingly.