This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.document | Sat May 16 06:19:52 -0700 2009 | |
| |
.gitignore | ||
| |
LICENSE | Sat May 16 06:19:52 -0700 2009 | |
| |
README.rdoc | Wed Jun 10 14:33:14 -0700 2009 | |
| |
Rakefile | ||
| |
VERSION.yml | ||
| |
have-code.gemspec | ||
| |
lib/ | ||
| |
test/ |
README.rdocmodulus specifies how many different plaintexts and ciphertexts are available.
a_key multiplied against the plaintext. Must be coprime with the modulus.
b_key added to the multiplied plaintext. No restrictions, but it’s modulus
math, so making it larger than modulus is useless.
have-code
Add clever little base36 codes for your DataMapper and ActiveRecord objects.
Whoa seriously??
# ActiveRecord
class Mug < ActiveRecord::Base
have_code 60466169, 12034710206, 81268112
end
initech = Mug.create :name=>'initech', :material=>'porcelain'
code = initech.code
initech == Mug.find_by_code code
# DataMapper
class Goblet
include DataMapper::Resource
property :id, Serial
property :name, String
property :material, String
have_code 60466169, 12034710206, 81268112
end
kohg = Goblet.create :name=>'king of hyrule', :material=>'gold'
code = kohg.code
kohg == Goblet.find_by_code code
What are those big numbers?
In order:
Change them to whatever you want, write tests to make sure they work as expected.
How secure is it?
Affine ciphers are incredibly easy to break. See the readme for the affine gem or en.wikipedia.org/wiki/Affine_cipher for more.
Dependencies
- affine
Copyright
Copyright © 2009 Bryce Kerley. See LICENSE for details.








