String...onvert(3pm)

πŸ“¦
version 0.02 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 🌟

  • pack
  • unpack
  • Data::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