ACME-Base64-Hexagram

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

Revision history for ACME-Base64-Hexagram

0.002   2026-07-31
        Document the order of the sequence.

0.001   2026-07-31
        First version, released on an unsuspecting world.

MANIFEST  view on Meta::CPAN

MANIFEST
Changes
xt/manifest.t
xt/pod-coverage.t
xt/pod.t
t/01-basic.t
lib/ACME/Base64/Hexagram.pm
Makefile.PL
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

META.json  view on Meta::CPAN

{
   "abstract" : "unknown",
   "author" : [
      "E. Choroba <choroba@matfyz.cz>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "ExtUtils::MakeMaker version 7.76, CPAN::Meta::Converter version 2.150010",
   "license" : [
      "artistic_2"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : 2
   },
   "name" : "ACME-Base64-Hexagram",
   "no_index" : {
      "directory" : [
         "t",
         "inc"
      ]
   },
   "prereqs" : {
      "build" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "perl" : "5.008003"
         }
      },
      "test" : {
         "requires" : {
            "Test::More" : "0"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/choroba/ACME-Base64-Hexagram/issues"
      },
      "repository" : {
         "type" : "git",
         "url" : "https://github.com/choroba/ACME-Base64-Hexagram.git",
         "web" : "https://github.com/choroba/ACME-Base64-Hexagram"
      }
   },
   "version" : "0.002",
   "x_serialization_backend" : "JSON::PP version 4.16"
}

META.yml  view on Meta::CPAN

---
abstract: unknown
author:
  - 'E. Choroba <choroba@matfyz.cz>'
build_requires:
  ExtUtils::MakeMaker: '0'
  Test::More: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.76, CPAN::Meta::Converter version 2.150010'
license: artistic_2
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: ACME-Base64-Hexagram
no_index:
  directory:
    - t
    - inc
requires:
  perl: '5.008003'
resources:
  bugtracker: https://github.com/choroba/ACME-Base64-Hexagram/issues
  repository: https://github.com/choroba/ACME-Base64-Hexagram.git
version: '0.002'
x_serialization_backend: 'CPAN::Meta::YAML version 0.020'

Makefile.PL  view on Meta::CPAN

use 5.008003;
use strict;
use warnings;
use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
    NAME             => 'ACME::Base64::Hexagram',
    AUTHOR           => ['E. Choroba <choroba@matfyz.cz>'],
    VERSION_FROM     => 'lib/ACME/Base64/Hexagram.pm',
    ABSTRACT_FROM    => 'lib/ACME/Base64/Hexagram.pm',
    LICENSE          => 'artistic_2',
    MIN_PERL_VERSION => '5.008003',
    CONFIGURE_REQUIRES => {
        'ExtUtils::MakeMaker' => '0',
    },
    TEST_REQUIRES => {
        'Test::More' => '0',
    },
    PREREQ_PM => {
        #'ABC'              => '1.6',
        #'Foo::Bar::Module' => '5.0401',
    },
    dist  => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean => { FILES => 'ACME-Base64-Hexagram-*' },
    META_MERGE => {
        'meta-spec' => { version => 2 },
        resources   => {
            repository => {
                type => 'git',
                url  => 'https://github.com/choroba/ACME-Base64-Hexagram.git',
                web  => 'https://github.com/choroba/ACME-Base64-Hexagram',
            },
            bugtracker => {
                web => 'https://github.com/choroba/ACME-Base64-Hexagram/issues',
            },
        },
    },
);

# Compatibility with old versions of ExtUtils::MakeMaker
unless (eval { ExtUtils::MakeMaker->VERSION('6.64'); 1 }) {
    my $test_requires = delete $WriteMakefileArgs{TEST_REQUIRES} || {};
    @{$WriteMakefileArgs{PREREQ_PM}}{keys %$test_requires} = values %$test_requires;
}

unless (eval { ExtUtils::MakeMaker->VERSION('6.55_03'); 1 }) {
    my $build_requires = delete $WriteMakefileArgs{BUILD_REQUIRES} || {};
    @{$WriteMakefileArgs{PREREQ_PM}}{keys %$build_requires} = values %$build_requires;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
    unless eval { ExtUtils::MakeMaker->VERSION('6.52'); 1 };
delete $WriteMakefileArgs{MIN_PERL_VERSION}
    unless eval { ExtUtils::MakeMaker->VERSION('6.48'); 1 };
delete $WriteMakefileArgs{LICENSE}
    unless eval { ExtUtils::MakeMaker->VERSION('6.31'); 1 };

WriteMakefile(%WriteMakefileArgs);

lib/ACME/Base64/Hexagram.pm  view on Meta::CPAN

package ACME::Base64::Hexagram;

use warnings;
use strict;
use utf8;

use MIME::Base64 qw{ encode_base64 decode_base64 };

use Exporter qw{ import };
our @EXPORT = qw{ encode_base64h decode_base64h };

our $VERSION = '0.002';

sub encode_base64h {
    my ($string) = @_;
    my $encoded = encode_base64($string);
    $encoded =~ tr{A-Za-z0-9+/=}{䷀䷁䷂䷃䷄䷅䷆䷇䷈䷉䷊䷋䷌䷍䷎䷏䷐䷑䷒䷓䷔䷕䷖䷗䷘䷙䷚䷛䷜䷝䷞䷟䷠䷡䷢䷣䷤䷥䷦䷧䷨䷩䷪䷫䷬䷭䷮䷯䷰䷱䷲䷳䷴䷵䷶䷷䷸䷹䷺䷻䷼䷽䷾䷿·};
    $encoded
}

sub decode_base64h {
    my ($encoded) = @_;
    $encoded =~ tr{䷀䷁䷂䷃䷄䷅䷆䷇䷈䷉䷊䷋䷌䷍䷎䷏䷐䷑䷒䷓䷔䷕䷖䷗䷘䷙䷚䷛䷜䷝䷞䷟䷠䷡䷢䷣䷤䷥䷦䷧䷨䷩䷪䷫䷬䷭䷮䷯䷰䷱䷲䷳䷴䷵䷶䷷䷸䷹䷺䷻䷼䷽䷾䷿·}{A-Za-z0-9+/=};
    my $decoded = decode_base64($encoded);
    $decoded
}


=head1 NAME

 ACME::Base64::Hexagram - Base64 encoding using I Ching hexagrams

=head1 SYNOPSIS

  use ACME::Base64::Hexagram qw{ decode_base64h encode_base64h };

  my $encoded = encode_base64h('The Book of Changes');

=head1 FUNCTIONS

=over 4

=item encode_base64h($string)

Returns the $string encoded in hexagrams.

=item decode_base64h($encoded)

Returns the decoded string back.

=back

=head1 ORDER

The module uses King Wen order.

=head1 THANKS

  #perl on Libera.chat
  thrig: there are 64 hexagrams. just saying.

=head1 AUTHOR

E. Choroba <chorobaE<64>matfyz.cz>

=cut

__PACKAGE__

t/01-basic.t  view on Meta::CPAN

#!/usr/bin/perl
use warnings;
use strict;
use utf8;

use ACME::Base64::Hexagram qw{ encode_base64h decode_base64h };

use Test::More tests => 2;


my $string = "Just Another Perl Hacker,\n";

my $result = "䷒䷧䷕䷳䷝䷂䷁䷁䷛䷦䷽䷴䷚䷆䷕䷲䷈䷅䷁䷥䷜䷦䷰䷠䷒䷆䷅䷣䷚䷶䷕䷲䷋䷀䷨·";

is encode_base64h($string), $result . "\n", 'encoding';
is decode_base64h($result), $string, 'decoding';

xt/manifest.t  view on Meta::CPAN

#!perl
use 5.008003;
use strict;
use warnings;
use Test::More;

my $min_tcm = 0.9;
eval "use Test::CheckManifest $min_tcm";
plan skip_all => "Test::CheckManifest $min_tcm required" if $@;

ok_manifest();

xt/pod-coverage.t  view on Meta::CPAN

#!perl
use 5.008003;
use strict;
use warnings;
use Test::More;

# Ensure a recent version of Test::Pod::Coverage
my $min_tpc = 1.08;
eval "use Test::Pod::Coverage $min_tpc";
plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
    if $@;

# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
# but older versions don't recognize some common documentation styles
my $min_pc = 0.18;
eval "use Pod::Coverage $min_pc";
plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
    if $@;

all_pod_coverage_ok();

xt/pod.t  view on Meta::CPAN

#!perl
use 5.008003;
use strict;
use warnings;
use Test::More;

# Ensure a recent version of Test::Pod
my $min_tp = 1.22;
eval "use Test::Pod $min_tp";
plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;

all_pod_files_ok();



( run in 0.810 second using v1.01-cache-2.11-cpan-b16cb0d3907 )