rucaptcha 2.5.5 → 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9d3d4dbd1dc22a2d97ed2d3d1fcc248621bbc97a90e0823c024244de9493c57
4
- data.tar.gz: 2d430de72e74176b92b021bf4f0462ba8f73ba147e3522c47f554ee8f72d3e9f
3
+ metadata.gz: f5b2533811c90fe898f944c4e680171223eae24d6a064325e7675874df062f38
4
+ data.tar.gz: a5580a8d7b93d5aa340fb7c3f34897a71ad253551edc5488a280f8d29810a5ad
5
5
  SHA512:
6
- metadata.gz: bc1c19827b035d8e50e4ce9c42d39f4df4ceff1682b1eacc866d69d3c61b4bf723b51705e1eb275880aa8b7161c7baeff6ca591b509528899c1097bd66381c65
7
- data.tar.gz: 0174b9a8e99f194d51fc69126f3fe1d38292b863db10fbbf8a76f2a1843ff23f882871613edc67c946c88a29cd26b9f37b3fd73b11457128cc1e6c371f234b29
6
+ metadata.gz: 19c9b89dd9752ec30778f3c8b5ebcd959df61b04df1ddb26dc8496c7b1383c935cd9cfcf7cfb2e80358a2aa732be2dc797b266f1d6a46ece618f162faa0474c8
7
+ data.tar.gz: 4fd7d61c12480361c640e0974908a9ae91f1b5a0a063da632b19b1627803ce047ea035a3816459615926408c927aa793de8e5571c9e4dc419013b3ba72c8d2e6
data/README.md CHANGED
@@ -3,20 +3,22 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/rucaptcha.svg)](https://badge.fury.io/rb/rucaptcha)
4
4
  [![build](https://github.com/huacnlee/rucaptcha/workflows/build/badge.svg)](https://github.com/huacnlee/rucaptcha/actions?query=workflow%3Abuild)
5
5
 
6
- This is a Captcha gem for Rails Applications which generates captcha image by C code.
6
+ Captcha Gem for Rails, which generates captcha image by Rust.
7
7
 
8
- > NOTE: According to the use of Ruby China, the verification code looks like has a lower than 5% probability of being parsed by OCR and the verification code is cracked. It is recommended that you use the IP rate limit to enhance the protection.
9
- > NOTE: 以 Ruby China 的使用来看,验证码似乎有低于 5% 的概率被 OCR 读取解析导致验证码被破解(我们从日志分析绝大多数是成功的,但偶尔一个成功,配合大量机器攻击,导致注册了很多的垃圾账号),建议你额外配合 IP 频率限制的功能来加强保护。
8
+ > NOTE: According to the use of Ruby China, the verification code looks like has a lower than 5% probability of being parsed by OCR and the verification code is cracked (All Image Captcha libs are has same problem). It is recommended that you use the IP rate limit to enhance the protection.
9
+ > NOTE: 以 Ruby China 的使用来看,验证码似乎有低于 5% 的概率被 OCR 读取解析 (图片验证码都有这个问题) 导致验证码被破解(我们从日志分析绝大多数是成功的,但偶尔一个成功,配合大量机器攻击,导致注册了很多的垃圾账号),建议你额外配合 IP 频率限制的功能来加强保护。
10
+
11
+ > 如果你需要更高强度的验证,建议选择商用服务。
10
12
 
11
13
  [中文介绍和使用说明](https://ruby-china.org/topics/27832)
12
14
 
13
15
  ## Example
14
16
 
15
- <img src="https://user-images.githubusercontent.com/5518/49985459-f8492f80-ffa6-11e8-9ef5-8f8f522e4707.png" width="579px" />
17
+ ![1](https://user-images.githubusercontent.com/5518/195587367-6b579046-1d75-4a64-8e8f-4475da8932fa.png) ![2](https://user-images.githubusercontent.com/5518/195587377-08065df4-80ad-4c3f-baf4-2da7f9919b19.png) ![3](https://user-images.githubusercontent.com/5518/195587383-de8f73ea-e934-4c9d-b278-c78fb69cad58.png) ![4](https://user-images.githubusercontent.com/5518/195587381-a67e586d-0b54-4d6f-89c8-a431b085e16c.png)
16
18
 
17
19
  ## Feature
18
20
 
19
- - No dependencies. No ImageMagick. No RMagick;
21
+ - Native Gem base on Rust.
20
22
  - For Rails Application;
21
23
  - Simple, Easy to use;
22
24
  - High performance.
@@ -33,8 +35,6 @@ Create `config/initializers/rucaptcha.rb`
33
35
 
34
36
  ```rb
35
37
  RuCaptcha.configure do
36
- # Color style, default: :colorful, allows: [:colorful, :black_white]
37
-  # self.style = :colorful
38
38
  # Custom captcha code expire time if you need, default: 2 minutes
39
39
  # self.expires_in = 120
40
40
   # [Requirement / 重要]
@@ -48,10 +48,6 @@ RuCaptcha.configure do
48
48
  # self.skip_cache_store_check = true
49
49
  # Chars length, default: 5, allows: [3 - 7]
50
50
  # self.length = 5
51
- # enable/disable Strikethrough.
52
- # self.strikethrough = true
53
- # enable/disable Outline style
54
- # self.outline = false
55
51
  end
56
52
  ```
57
53
 
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "rake/extensiontask"
4
+ require "rubygems/package_task"
5
+ require "bundler"
6
+
7
+ CROSS_PLATFORMS = %w[
8
+ aarch64-linux
9
+ arm64-darwin
10
+ x64-mingw32
11
+ x86_64-darwin
12
+ x86_64-linux
13
+ ]
14
+
15
+ spec = Bundler.load_gemspec("rucaptcha.gemspec")
16
+
17
+ Gem::PackageTask.new(spec).define
18
+
19
+ Rake::ExtensionTask.new("rucaptcha", spec) do |ext|
20
+ ext.lib_dir = "lib/rucaptcha"
21
+ ext.source_pattern = "*.{rs,toml}"
22
+ ext.cross_compile = true
23
+ ext.cross_platform = CROSS_PLATFORMS
24
+ end
25
+
26
+ RSpec::Core::RakeTask.new(:spec)
27
+ task default: :spec
28
+
29
+ task :preview do
30
+ require "rucaptcha"
31
+ res = RuCaptchaCore.create(5, 5)
32
+ warn res[0]
33
+ puts res[1].pack("c*")
34
+ end