bkerley-have-code 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +32 -1
- data/VERSION.yml +1 -1
- data/have-code.gemspec +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -5,18 +5,49 @@ Add clever little base36 codes for your DataMapper and ActiveRecord objects.
|
|
5
5
|
== Whoa seriously??
|
6
6
|
|
7
7
|
# ActiveRecord
|
8
|
+
class Mug < ActiveRecord::Base
|
9
|
+
have_code 60466169, 12034710206, 81268112
|
10
|
+
end
|
11
|
+
|
8
12
|
initech = Mug.create :name=>'initech', :material=>'porcelain'
|
9
13
|
code = initech.code
|
10
14
|
initech == Mug.find_by_code code
|
11
15
|
|
12
16
|
# DataMapper
|
17
|
+
class Goblet
|
18
|
+
include DataMapper::Resource
|
19
|
+
property :id, Serial
|
20
|
+
property :name, String
|
21
|
+
property :material, String
|
22
|
+
have_code 60466169, 12034710206, 81268112
|
23
|
+
end
|
13
24
|
kohg = Goblet.create :name=>'king of hyrule', :material=>'gold'
|
14
25
|
code = kohg.code
|
15
26
|
kohg == Goblet.find_by_code code
|
16
27
|
|
28
|
+
== What are those big numbers?
|
29
|
+
|
30
|
+
In order:
|
31
|
+
|
32
|
+
[modulus] specifies how many different plaintexts and ciphertexts
|
33
|
+
are available.
|
34
|
+
[a_key] multiplied against the plaintext. <b>Must be coprime with
|
35
|
+
the modulus.</b>
|
36
|
+
[b_key] added to the multiplied plaintext. No restrictions, but
|
37
|
+
it's modulus math, so making it larger than +modulus+ is
|
38
|
+
useless.
|
39
|
+
|
40
|
+
Change them to whatever you want, write tests to make sure they work
|
41
|
+
as expected.
|
42
|
+
|
43
|
+
== How secure is it?
|
44
|
+
|
45
|
+
Affine ciphers are incredibly easy to break. See the readme for the
|
46
|
+
+affine+ gem or http://en.wikipedia.org/wiki/Affine_cipher for more.
|
47
|
+
|
17
48
|
== Dependencies
|
18
49
|
|
19
|
-
*
|
50
|
+
* affine
|
20
51
|
|
21
52
|
== Copyright
|
22
53
|
|
data/VERSION.yml
CHANGED
data/have-code.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{have-code}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Bryce Kerley"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-06-10}
|
10
10
|
s.email = %q{bkerley@brycekerley.net}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bkerley-have-code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryce Kerley
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|