summaryrefslogtreecommitdiff
path: root/lib/Enigmatic/Role/Rotate.pm
blob: 7ce094687ab83ca2471d2f276c2faee2682e4f54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package Enigmatic::Role::Rotate; 
use DAKKAR::p 'role';
 
sub _rotate_by {
    my ($letter,$position) = @_;
 
    return chr(ord('A')+
               (ord($letter)-ord('A')+26+$position)%26);
}
 
__END__
 
=head1 AUTHOR
 
Gianni Ceccarelli <dakkar@thenautilus.net>
 
=head1 COPYRIGHT AND LICENSE
 
This software is copyright (c) 2011 by Gianni Ceccarelli.
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, version 3.
 
=cut