Convert Ascii to Binary



Published: 2018-09-20 22:12:39 +0000
Categories: BASH,

Language

BASH

Description

Simple one liner to dump an Ascii string out in binary

Snippet

echo $MESSAGE | perl -lpe '$_=unpack"B*",$_'

# To convert back
echo $BINARY | perl -lpe '$_=pack"B*",$_'

Usage Example

$ echo Hello World | perl -lpe '$_=unpack"B*",$_'
0100100001100101011011000110110001101111001000000101011101101111011100100110110001100100

$ echo 0100100001100101011011000110110001101111001000000101011101101111011100100110110001100100 | perl -lpe '$_=pack"B*",$_'
Hello World

Keywords

Ascii, Binary, Convert,

Latest Posts

Remotely backing up PFsense Configuration (BASH)
FFMPEG: Converting RMVB to X264 MP4 (BASH)
Recursively print table (print_r equivalent) (LUA)
Bulk Delete Comments from (Self-Hosted) JIRA Issues (Misc)
Add a static entry to the ARP table (BASH)
SSL Cipher Hex codes to Human Readable Names (Misc)
Convert Ascii to Binary (BASH)
Intercepting Outbound DNS Queries (BASH)
Handle Google Verification files within NGinx Configuration (NGinx)
Getting WhatsApp Rich Snippet Previews Working (Misc)

Copyright © 2018 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk and snippets.6zdgh5a5e6zpchdz.onion