README.md in ip_anonymizer-0.1.1 vs README.md in ip_anonymizer-0.2.0
- old
+ new
@@ -4,18 +4,18 @@
Works with IPv4 and IPv6
Designed to help with [GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation) compliance
-[![Build Status](https://travis-ci.org/ankane/ip_anonymizer.svg?branch=master)](https://travis-ci.org/ankane/ip_anonymizer)
+[![Build Status](https://github.com/ankane/ip_anonymizer/workflows/build/badge.svg?branch=master)](https://github.com/ankane/ip_anonymizer/actions)
## Getting Started
Add these lines to your application’s Gemfile:
```ruby
-gem 'ip_anonymizer'
+gem "ip_anonymizer"
```
There are two strategies for anonymizing IPs.
### Masking
@@ -45,16 +45,16 @@
IpAnonymizer.hash_ip("2001:4860:4860:0:0:0:0:8844", key: "secret")
# => "f6e4:a4fe:32dc:2f39:3e47:84cc:e85e:865c"
```
-An advantage of this approach is different IPs will have different hashes.
+An advantage of this approach is different IPs will have different hashes (with the exception of collisions).
-Make sure the key is kept secret and at least 30 random characters. Otherwise, a rainbow table can be constructed. In Rails, you can generate a good key with:
+Make sure the key is kept secret and at least 30 random characters. Otherwise, a rainbow table can be constructed. You can generate a good key with:
-```sh
-rails secret
+```ruby
+SecureRandom.hex(32)
```
## Rails
Automatically anonymize `request.remote_ip` in Rails.
@@ -86,13 +86,13 @@
- [Report bugs](https://github.com/ankane/ip_anonymizer/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/ip_anonymizer/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
-To get started with development and testing:
+To get started with development:
```sh
git clone https://github.com/ankane/ip_anonymizer.git
cd ip_anonymizer
bundle install
-rake test
+bundle exec rake test
```