Math::Base85(3pm)

πŸ“¦
version 0.5 Β· 6 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Math::Base85 β€” a Perl extension for base 85 numbers, as referenced by RFC 1924. bestie, it's giving hexadecimal's cooler older sister ✨


🌸 SYNOPSIS 🌸

use Math::Base85;

$bigint = from_base85($number);
$b85str = to_base85($bigint);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so RFC 1924 describes a compact, fixed-size way to represent IPv6 addresses, and it uses a base 85 number system. this module handles some of the uglier details of that for you, no cap πŸ’…

the base 85 numbers (from 0 to 84) go like this, and honestly the alphabet is so chaotic, periodt:

0..9 A..Z a..z ! # $ % & ( ) * + - ; < = > ? @ ^ _ ` { | } ~

at the moment there's not much in this module (it's a short king πŸ‘‘), but it should be sufficient for the purposes of RFC 1924, fr fr.

this module has a variable called $Math::Base85::base85_digits, which is a string containing the digits of the base 85 alphabet from lowest (0) to highest (~), in that order. πŸŽ€

additionally, the following two functions are defined for general use. (they will be exported upon request, iykyk 🫢)

πŸ’œ from_base85 πŸ’œ

Parameters

a string composed of valid base 85 digits. ✨

Returns

a "Math::BigInt" object representing the number. slay.

🧚 to_base85 🧚

Parameters

a "Math::BigInt" object. 🌈

Returns

a string of base 85 digits representing the number. iconic.


πŸ‘‘ AUTHORS πŸ‘‘

  • Tony Monroe <tmonroe+perl@nog.net> πŸ’–
  • Paul Cochrane <paul@liekut.de> (maintainer) 🫢

Copyright (c) 2001-2002, Tony Monroe <tmonroe+perl@nog.net>. All rights reserved. Copyright (c) 2017, Paul Cochrane <paul@liekut.de>. All rights reserved.

you may use this software under the same terms as Perl itself. πŸŽ€


πŸ”₯ SEE ALSO πŸ”₯


that's the whole vibe check, bestie πŸ’–

and just so we're keeping the receipts, this page is from perl v5.36.0, dated 2022-10-22, and it lives under the name Math::Base85(3pm). stay iconic, go read it again if you forgot something πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from