rucaptcha 3.0.0.beta1-x86_64-linux → 3.0.0-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ru_captcha/captcha_controller.rb +14 -0
- data/config/routes.rb +3 -0
- data/ext/rucaptcha/src/captcha.rs +4 -4
- data/lib/rucaptcha/2.7/rucaptcha.so +0 -0
- data/lib/rucaptcha/3.0/rucaptcha.so +0 -0
- data/lib/rucaptcha/3.1/rucaptcha.so +0 -0
- data/lib/rucaptcha/version.rb +1 -1
- data/lib/rucaptcha.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b3195ba618a23927778730c4269d47a6e0d5de06b17a1e418c11cf957a122d5
|
4
|
+
data.tar.gz: 28a8511053db42c65b3b2388713a08f8f85dc0d9776a283f35db4d7b09d24fbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bdae8fa47a9b2206bc4892018b0d0d9c70c04c6a7416ce85a7273af0fee42d54ad56bf5faad513f517a6a7eab901a3b091b06ff37f5b7741e24149a397865dd
|
7
|
+
data.tar.gz: de4a587b2a61e0ac5673ee366b93c0a5e41ec651bb1c08ae8469af9f2f6eca1e0d43baf733255632557aed10432b11d24249b39e334ac4e5b9030fcda424b6ce
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module RuCaptcha
|
2
|
+
class CaptchaController < ActionController::Base
|
3
|
+
def index
|
4
|
+
return head :ok if request.head?
|
5
|
+
|
6
|
+
headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
|
7
|
+
headers["Pragma"] = "no-cache"
|
8
|
+
data = generate_rucaptcha
|
9
|
+
|
10
|
+
opts = { disposition: "inline", type: "image/png" }
|
11
|
+
send_data data, opts
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/config/routes.rb
ADDED
@@ -105,8 +105,8 @@ fn cyclic_write_character(res: &[String], image: &mut ImageBuffer<Rgb<u8>, Vec<u
|
|
105
105
|
let font = get_font();
|
106
106
|
let line_color = colors[rand_num(colors.len() - 1)];
|
107
107
|
|
108
|
-
for j in 0..(rand_num(
|
109
|
-
let offset = j * (rand_num(
|
108
|
+
for j in 0..(rand_num(3) + 1) as i32 {
|
109
|
+
let offset = j * (rand_num(2) as i32 + 1);
|
110
110
|
draw_text_mut(
|
111
111
|
image,
|
112
112
|
color,
|
@@ -182,8 +182,8 @@ impl CaptchaBuilder {
|
|
182
182
|
pub fn new() -> Self {
|
183
183
|
CaptchaBuilder {
|
184
184
|
length: 4,
|
185
|
-
width:
|
186
|
-
height:
|
185
|
+
width: 300,
|
186
|
+
height: 100,
|
187
187
|
complexity: 5,
|
188
188
|
}
|
189
189
|
}
|
Binary file
|
Binary file
|
Binary file
|
data/lib/rucaptcha/version.rb
CHANGED
data/lib/rucaptcha.rb
CHANGED
@@ -48,7 +48,7 @@ module RuCaptcha
|
|
48
48
|
raise RuCaptcha::Errors::Configuration, "length config error, value must in 3..7" unless length.in?(3..7)
|
49
49
|
|
50
50
|
result = RuCaptchaCore.create(length, config.difficulty || 5)
|
51
|
-
[result[0], result[1].pack("c*")]
|
51
|
+
[result[0].downcase, result[1].pack("c*")]
|
52
52
|
end
|
53
53
|
|
54
54
|
def check_cache_store!
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rucaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
@@ -46,6 +46,8 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- README.md
|
48
48
|
- Rakefile
|
49
|
+
- app/controllers/ru_captcha/captcha_controller.rb
|
50
|
+
- config/routes.rb
|
49
51
|
- ext/rucaptcha/Cargo.lock
|
50
52
|
- ext/rucaptcha/Cargo.toml
|
51
53
|
- ext/rucaptcha/extconf.rb
|
@@ -80,9 +82,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
82
|
version: 3.2.dev
|
81
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
84
|
requirements:
|
83
|
-
- - "
|
85
|
+
- - ">="
|
84
86
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
87
|
+
version: '0'
|
86
88
|
requirements: []
|
87
89
|
rubygems_version: 3.4.0.dev
|
88
90
|
signing_key:
|