Skip to content

Emeric54/p6-text-caesar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text::Caesar

Synopsis

use Text::Caesar;

my $message = Message.new(
    key => 3,
    text => "I am a secret message"
);
my $secret = Secret.new(
    key => 3,
    text => $message.encrypt();
);
say $message.encrypt;
say $secret.decrypt;

Installation

To install it using Panda (a module management tool bundled with Rakudo Star):

$ panda install Text::Caesar

Or with Zef:

$ zef install Text::Caesar

Description

This module allows you to use 4 functions.

You can encrypt a message :

use v6;

use Text::Caesar;

my Str $secret = "I'm a secret message.";
my Str $message = encrypt(3, $secret);
say $message;

You can decrypt a message :

my Str $secret = 'LPDVHFUHWPHVVDJH'
my Str $message = decrypt(3, $secret);
say $message;

You can encrypt (or decrypt) a file :

encrypt-from-file($key, $origin, $destination)

This code will encrypt $origin's text into the $destination file.

You can also use objects :

my $message = Message.new(
    key => 3,
    text => "I am a secret message"
);
say $message.encrypt;
my $secret = Secret.new(
    key => 3,
    text => $message.encrypt();
);
say $secret.decrypt;

Author

Emeric Fischer [email protected], emeric on freenode.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

  • Other 100.0%