ip_anonymizer 0.2.0 → 0.3.0

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: f454e201a3d9c2f4289e2b0c6e367bffbed093f74dbcc6feeb1325ca39aa7a84
4
- data.tar.gz: 312f1dcaf7e753febe323c9aed56b5847d1c1bfba84a2231fa79b73e34d8ec5a
3
+ metadata.gz: 8fca3d0e40cc438ec8f6ed699b844f7d6e731f8b3604963afedd62a3aeb8d635
4
+ data.tar.gz: 90057058cce03ec1c9fa647891f699ed22cac1caa9b9af3f84aa664760c64294
5
5
  SHA512:
6
- metadata.gz: 8e5ad0bba1c72b3753e4b9218af6139df2cc0833cb3334e7b508740771ae6d3e3201773674ee2442d242807bf943cd46d93e75ce85271fb8a13fb7e499245ea0
7
- data.tar.gz: e800b290819f4854464d21bd73451a2a5c39ea5598155267323c34a59552f3efb1139eb4881b2a2e952f08b4435c07e2113ababf85061da9e399d9d89365fa38
6
+ metadata.gz: ef7802170105a8e1d56074b3463b898dc44e585feb9c9d0e10199fc7e22e1489e779be3a928321228762af92ff9c0513350f99b39ddb76af49ed9031ee27fca7
7
+ data.tar.gz: 4fb6532abee3a955048982759c822dca5c3408354965cbccc7d8b320197c17d2993c07d75221c2d55cda2dc0d5747218349f2f64b5c0dd3f530a9080ba1ac7d5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.0 (2024-06-24)
2
+
3
+ - Dropped support for Ruby < 3.1
4
+
1
5
  ## 0.2.0 (2022-10-09)
2
6
 
3
7
  - Dropped support for Ruby < 2.7
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2018-2022 Andrew Kane
3
+ Copyright (c) 2018-2024 Andrew Kane
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,3 +1,3 @@
1
1
  module IpAnonymizer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/ip_anonymizer.rb CHANGED
@@ -3,9 +3,9 @@ require "ipaddr"
3
3
  require "openssl"
4
4
 
5
5
  # modules
6
- require "ip_anonymizer/hash_ip"
7
- require "ip_anonymizer/mask_ip"
8
- require "ip_anonymizer/version"
6
+ require_relative "ip_anonymizer/hash_ip"
7
+ require_relative "ip_anonymizer/mask_ip"
8
+ require_relative "ip_anonymizer/version"
9
9
 
10
10
  module IpAnonymizer
11
11
  def self.mask_ip(ip)
@@ -24,7 +24,7 @@ module IpAnonymizer
24
24
  key_len = addr.ipv4? ? 4 : 16
25
25
  family = addr.ipv4? ? Socket::AF_INET : Socket::AF_INET6
26
26
 
27
- keyed_hash = OpenSSL::PKCS5.pbkdf2_hmac(addr.to_s, key, iterations, key_len, "sha256")
28
- IPAddr.new(keyed_hash.bytes.inject {|a, b| (a << 8) + b }, family).to_s
27
+ keyed_hash = OpenSSL::KDF.pbkdf2_hmac(addr.to_s, salt: key, iterations: iterations, length: key_len, hash: "sha256")
28
+ IPAddr.new(keyed_hash.bytes.inject { |a, b| (a << 8) + b }, family).to_s
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ip_anonymizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-10 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -35,14 +35,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: '2.7'
38
+ version: '3.1'
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []
45
- rubygems_version: 3.3.7
45
+ rubygems_version: 3.5.11
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: IP address anonymizer for Ruby and Rails