Ruby's un/pack is of course heavily inspired by Perl's: https://perldoc.perl.org/functions/pack
However, slicing strings is a little easier syntax-wise than in Perl.