ctf-party 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ctf_party.rb +1 -0
- data/lib/ctf_party/dec.rb +49 -0
- data/lib/ctf_party/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09406956f91fdbe561c73f343efc68e28ad20c774370053e88472ebb1bb5098
|
4
|
+
data.tar.gz: 8bf8dfddfdbb4780578216b022d4815778f6f79d489506a2dba9fa0355bc8f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40adf3307a9e8b99ccda9af3d1ab063413433998455cf92c292eb9b6e8d3deb754280673e796d7d980e22c87c222b7eb07c1fd7a6434d4597c186857ea973937
|
7
|
+
data.tar.gz: e3d1bbf14cf1dd05112833a7fa8096acaf0ee6065a266990fa56a71c30415f504a83255c8ae835188dfbd25593e37b983d06b7c137ed5e3d0598ebd3dcc83edd
|
data/lib/ctf_party.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class String
|
4
|
+
# Encode a string into decimal (string to hexadecimal then hexadecimal to decimal)
|
5
|
+
# @return [String] the decimal encoded string
|
6
|
+
# @example
|
7
|
+
# 'noraj'.to_dec # => "474316169578"
|
8
|
+
def to_dec
|
9
|
+
str2hex.hex2dec
|
10
|
+
end
|
11
|
+
|
12
|
+
# Encode a string into decimal in place as described for {String#to_dec}.
|
13
|
+
def to_dec!
|
14
|
+
replace(to_dec)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Decode a decimal string (decimal to hexadecimal then hexadecimal to string)
|
18
|
+
# @return [String] the decimal decoded string
|
19
|
+
# @example
|
20
|
+
# '1834615104613964215417'.from_dec # => "ctf-party"
|
21
|
+
def from_dec
|
22
|
+
dec2hex.hex2str
|
23
|
+
end
|
24
|
+
|
25
|
+
# Decode a decimal string in place as described for {String#from_dec}.
|
26
|
+
def from_dec!
|
27
|
+
replace(from_dec)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Alias for {String#to_dec}.
|
31
|
+
def str2dec
|
32
|
+
to_dec
|
33
|
+
end
|
34
|
+
|
35
|
+
# Alias for {String#to_dec!}.
|
36
|
+
def str2dec!
|
37
|
+
replace(str2dec)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Alias for {String#from_dec}.
|
41
|
+
def dec2str
|
42
|
+
from_dec
|
43
|
+
end
|
44
|
+
|
45
|
+
# Alias for {String#from_dec!}.
|
46
|
+
def dec2str!
|
47
|
+
replace(dec2str)
|
48
|
+
end
|
49
|
+
end
|
data/lib/ctf_party/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctf-party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre ZANNI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '4.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '4.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/ctf_party/binary.rb
|
153
153
|
- lib/ctf_party/case.rb
|
154
154
|
- lib/ctf_party/cgi.rb
|
155
|
+
- lib/ctf_party/dec.rb
|
155
156
|
- lib/ctf_party/digest.rb
|
156
157
|
- lib/ctf_party/flag.rb
|
157
158
|
- lib/ctf_party/hex.rb
|