Skip to main content
base64-encoding Encoding and decoding utilities — base64, URL encoding, hex, and hashing. Use when user mentions "base64", "encode", "decode", "url encode", "urlencode", "hex", "hash", "sha256", "md5", "checksum", "jwt decode", "binary to text", or converting between encoding formats.
Ir para a instalação Skills Marketplace Descubra e explore skills de IA criadas pela comunidade.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Copiar promptMostrar detalhes do prompt Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
npx skills add https://github.com/1Mangesh1/dev-skills-collection --skill base64-encodingO comando permanece em uma só linha. Role horizontalmente para revisá-lo antes de copiar.
Prefere uma cópia local? Baixe os arquivos disponíveis atualmente no SkillsMP.
Baixar Zip Baixando... Mais deste repositório REST API design patterns, structure, and best practices. Use when user asks to "design a REST API", "create API endpoints", "write OpenAPI spec", "design API routes", "add pagination to API", "version an API", "create API schema", "design webhook endpoints", "structure API responses", "implement HATEOAS", "design API errors", "API versioning", "API deprecation", "rate limiting design", or mentions REST API design, endpoint naming, HTTP methods, status codes, API best practices, request/response design, or API documentation.
Caching strategies and implementation patterns. Use when user asks to "add caching", "cache API responses", "set up CDN caching", "configure HTTP caching", "implement memoization", "cache database queries", "set cache headers", "invalidate cache", "design cache layer", "reduce API latency", "cache warming", "cache busting", "distributed caching", "Redis caching", "edge caching", or mentions caching strategies, cache invalidation, TTL, cache-aside, write-through, write-behind, CDN, browser caching, or memoization.
CI/CD pipeline design, setup, and optimization. Use when user asks to "set up CI/CD", "create a pipeline", "configure Jenkins", "set up GitLab CI", "create CircleCI config", "automate deployments", "create build pipeline", "set up continuous deployment", "configure pipeline stages", "add pipeline caching", "pipeline security", "secret management", "artifact management", "GitHub Actions workflow", "deployment strategies", "canary deployment", or mentions CI/CD pipelines, continuous integration, continuous deployment, build automation, deployment pipelines, or pipeline optimization.
Ocupações relacionadas SOC
Baseado na classificação ocupacional SOC
name base64-encoding description Encoding and decoding utilities — base64, URL encoding, hex, and hashing. Use when user mentions "base64", "encode", "decode", "url encode", "urlencode", "hex", "hash", "sha256", "md5", "checksum", "jwt decode", "binary to text", or converting between encoding formats.
Encoding and Decoding Utilities
Base64 Encode/Decode
String
echo -n 'hello world' | base64
echo 'aGVsbG8gd29ybGQ=' | base64 -D
echo 'aGVsbG8gd29ybGQ=' | base64 -d
File
base64 < input.bin > output.b64
base64 -D < output.b64 > restored.bin
base64 -d < output.b64 > restored.bin
Stdin pipe
curl -s https://example.com/image.png | base64
macOS vs Linux
Operation macOS Linux Decode base64 -Dbase64 -d
Wrap cols base64 -b 76base64 -w 76
Portable: base64 --decode 2>/dev/null || base64 -D
URL Encoding/Decoding
python3 -c "import urllib.parse; print(urllib.parse.quote('hello world&foo=bar'))"
python3 -c "import urllib.parse; print(urllib.parse.unquote('hello%20world%26foo%3Dbar'))"
node -e "console.log(encodeURIComponent('hello world&foo=bar'))"
node -e "console.log(decodeURIComponent('hello%20world%26foo%3Dbar'))"
Hex Encode/Decode
echo -n 'hello' | xxd -p
echo '68656c6c6f' | xxd -r -p
xxd input.bin
xxd -p input.bin
echo -n 'hello' | od -A n -t x1 | tr -d ' \n'
printf '\x68\x65\x6c\x6c\x6f'
Hashing
String hashing
echo -n 'hello' | md5sum
echo -n 'hello' | md5
echo -n 'hello' | sha1sum
echo -n 'hello' | shasum -a 1
echo -n 'hello' | sha256sum
echo -n 'hello' | shasum -a 256
echo -n 'hello' | sha512sum
echo -n 'hello' | shasum -a 512
Use echo -n to avoid hashing the trailing newline.
File hashing sha256sum myfile.tar.gz
shasum -a 256 myfile.tar.gz
OpenSSL (cross-platform) openssl dgst -sha256 myfile.tar.gz
echo -n 'hello' | openssl dgst -sha256
Verify File Integrity with Checksums
sha256sum release.tar.gz > release.sha256
sha256sum -c release.sha256
shasum -a 256 -c release.sha256
EXPECTED="e3b0c44298fc1c149afbf4c8996fb924..."
ACTUAL=$(sha256sum downloaded.tar.gz | awk '{print $1}' )
[ "$EXPECTED " = "$ACTUAL " ] && echo "OK" || echo "MISMATCH"
JWT Decode Without a Library A JWT has three dot-separated base64url segments: header, payload, signature.
JWT="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U"
echo "$JWT " | cut -d. -f1 | tr '_-' '/+' | base64 -d 2>/dev/null || \
echo "$JWT " | cut -d. -f1 | tr '_-' '/+' | base64 -D
echo "$JWT " | cut -d. -f2 | tr '_-' '/+' | base64 -d 2>/dev/null || \
echo "$JWT " | cut -d. -f2 | tr '_-' '/+' | base64 -D
Base64url uses - and _ instead of + and /. The tr call converts back. Add padding if needed:
decode_b64url () {
local d="$1 " pad=$(( 4 - ${#1} % 4 ))
[ "$pad " -lt 4 ] && d="${d} $(printf '%0.s=' $(seq 1 $pad) )"
echo "$d " | tr '_-' '/+' | base64 -d 2>/dev/null || echo "$d " | tr '_-' '/+' | base64 -D
}
decode_b64url "$(echo "$JWT " | cut -d. -f2) "
Generate Random Strings
cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 32
openssl rand -hex 16
openssl rand -base64 24
openssl rand -base64 32 | tr '+/' '-_' | tr -d '='
cat /proc/sys/kernel/random/uuid 2>/dev/null || uuidgen
HTML Entity Encode/Decode
python3 -c "import html; print(html.escape('<div class=\"x\">&</div>'))"
python3 -c "import html; print(html.unescape('<div>hello</div>'))"
perl -MHTML::Entities -e 'print decode_entities("<p>hello</p>")'
Unicode Escape/Unescape
python3 -c "print('\\u0048\\u0065\\u006c\\u006c\\u006f')"
python3 -c "print(''.join(f'\\\\u{ord(c):04x}' for c in 'Hello'))"
echo '"\\u0048\\u0065\\u006c\\u006c\\u006f"' | jq -r .
printf '\xc3\xa9'
echo -n 'é' | xxd -p
Common Patterns
Encode a file for JSON embedding BASE64=$(base64 < image.png | tr -d '\n' )
echo "{\"image\": \"data:image/png;base64,${BASE64} \"}"
Decode a base64 field from an API response curl -s https://api.example.com/data | jq -r '.content' | base64 -d
Verify a download checksum curl -LO https://example.com/release.tar.gz
curl -sL https://example.com/release.sha256 | sha256sum -c -
Generate an API key openssl rand -base64 32 | tr -d '\n'
openssl rand -hex 32
Encode credentials for Basic Auth echo -n 'user:password' | base64
Quick Reference Task Command Base64 encode string echo -n 'text' | base64Base64 decode (macOS) echo 'data' | base64 -DBase64 decode (Linux) echo 'data' | base64 -dURL encode python3 -c "import urllib.parse; print(urllib.parse.quote('...'))"URL decode python3 -c "import urllib.parse; print(urllib.parse.unquote('...'))"Hex encode echo -n 'text' | xxd -pHex decode echo 'hex' | xxd -r -pMD5 hash echo -n 'text' | openssl dgst -md5SHA-256 hash echo -n 'text' | openssl dgst -sha256SHA-256 file openssl dgst -sha256 file.tar.gzVerify checksum sha256sum -c checksums.sha256JWT decode payload echo $JWT | cut -d. -f2 | tr '_-' '/+' | base64 -dRandom hex (32 chars) openssl rand -hex 16Random base64 openssl rand -base64 24HTML encode python3 -c "import html; print(html.escape('...'))"HTML decode python3 -c "import html; print(html.unescape('...'))"Unicode unescape python3 -c "print('\\u0048\\u0065')"Basic Auth header echo -n 'user:pass' | base64