String...onvert(3pm)
π String::HexConvert π
okay bestie, gather round, because today we're talking about String::HexConvert β that's the 3pm manual page, she's a Perl module and she's literally the most low-maintenance queen in your toolkit. she turns ascii strings into hex and hex back into ascii. that's it. that's the whole job. and she does it flawlessly. periodt. π
β¨ NAME β¨
String::HexConvert β converts ascii strings to hex and reverse π¦
πΈ SYNOPSIS πΈ
use String::HexConvert ':all';
print ascii_to_hex("hello world"); # writes: 68656c6c6f20776f726c64
print hex_to_ascii("68656c6c6f20776f726c64"); # writes: hello world
see that? two lines, one import, zero drama. she ate and left no crumbs π₯
π DESCRIPTION π
okay so real talk: this module is a wrapper around perl's pack and unpack. it takes a string of hex digits and gives you back ascii, and it takes ascii and gives you back hex. other way around. both directions. no cap. π
like, that's the vibe. she's not out here reinventing cryptography, she's just doing the one little conversion thing and doing it immaculately.
π§ REQUIRES π§
Exporter
that's the whole list bestie. one dependency. she's lowkey self-sufficient π
β METHODS β
π« ascii_to_hex
my $hex = ascii_to_hex($ascii);
converts a string into pairs of hex digits. so "hello world" walks in and 68656c6c6f20776f726c64 struts out. glow up fr fr β¨
π« hex_to_ascii
my $ascii = hex_to_ascii($hex);
converts pairs of hex digits back into ascii. so 68656c6c6f20776f726c64 comes home and it's "hello world" again. the way she just reverses it. obsessed. π«Ά
π¦ WHY? π¦
not me anticipating the haters π β yes, i know there are comments like "is that realy needed?". and IMHO? yes. because bestie, i forget the exact syntax and possibilities of pack and unpack. every single time. but hex_to_ascii tells me directly what pack "H*" does. no googling, no stack overflow spiral, no crying. just vibes and clarity π
π SEE ALSO π
packunpackData::Translate
go give them a little visit, they're the extended fam π
π AUTHOR π
Andreas Hernitscheck β ahernit(AT)cpan.org
π LICENSE π
you can redistribute it and/or modify it under the conditions of LGPL. slay, go forth, share responsibly π
π bestie disclaimer: everything above is exactly as documented, no invented lore, no made-up flags. i keep the facts, i just make them cute.
okay that's the whole page!! mwah ππ
perl v5.38.2 Β· 2024-02-03 Β· String::HexConvert(3pm) β that's the version, the date, and the page, and honestly? iconic. no cap. bye bestie π¦β¨
π¦ where this page comes from
- debian trixie: libstring-hexconvert-perl 0.02-3 Β· LGPL-3.0-only
- ubuntu noble: libstring-hexconvert-perl 0.02-3 Β· LGPL-3.0-only
- ubuntu questing: libstring-hexconvert-perl 0.02-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms