cryptopunks 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +109 -0
- data/lib/cryptopunks.rb +6 -2
- data/lib/cryptopunks/composite.rb +6 -12
- data/lib/cryptopunks/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f5a03075399de98c5456fd8c74bcd84c2bebea84b033131351c737dd1934ba
|
4
|
+
data.tar.gz: cb75041e34f7104b4e19ab9913a66d3383273299f0a2bec10b53d2c6d428f4f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258ce6be66ad8a06dae14aeb916e620549e50e2dc82a3d96964dbd31e7766df5205b89e630cf3c703b2dbbc52d0e14c4314751447e200ceab47fc7d8bbc81891
|
7
|
+
data.tar.gz: c5d5556a2a644a25431f666fb46aa667c0460a721e379b43e17284e4400cb3b515e34d10fa28f2105dd0b45ea5c2bb039518bd45cf59aa2e1da8e98be455871e
|
data/README.md
CHANGED
@@ -117,6 +117,115 @@ And x8:
|
|
117
117
|
And so on.
|
118
118
|
|
119
119
|
|
120
|
+
|
121
|
+
|
122
|
+
## 10 000 More Punks - Unauthorized? No Way?!- Fuck the Establishment - Yes, You Can - Do-It-Yourself - Use Your Own Collections
|
123
|
+
|
124
|
+
|
125
|
+
Use the `-f, --file=FILE` option
|
126
|
+
to pass along any unauthorized edition.
|
127
|
+
Only make sure all punks are lined-up left-to-right, top-to-bottom
|
128
|
+
in the 24x24 pixel format in the composite image.
|
129
|
+
|
130
|
+
|
131
|
+
Let's try the 10 000 More Punks series housing punks in
|
132
|
+
packs of a hundred each. Let's have a looksie at the first 100
|
133
|
+
in the series.
|
134
|
+
|
135
|
+
|
136
|
+

|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
Let's mint punk #0, #19, #50, and #89
|
141
|
+
and let's add an offset of 10000
|
142
|
+
(to start counting at 10000 instead of 0):
|
143
|
+
|
144
|
+
```
|
145
|
+
$ punk 0 18 40 88 --file ./more-punks-1.png --offset 10000
|
146
|
+
```
|
147
|
+
|
148
|
+
printing:
|
149
|
+
|
150
|
+
```
|
151
|
+
==> reading >./more-punks-1.png<...
|
152
|
+
240x240 (height x width)
|
153
|
+
==> (1/4) minting punk #10000; writing to >./punk-10000.png<...
|
154
|
+
==> (2/4) minting punk #10018; writing to >./punk-10018.png<...
|
155
|
+
==> (3/4) minting punk #10040; writing to >./punk-10040.png<...
|
156
|
+
==> (4/4) minting punk #10040; writing to >./punk-10088.png<...
|
157
|
+
```
|
158
|
+
|
159
|
+
And voila!
|
160
|
+
|
161
|
+

|
162
|
+

|
163
|
+

|
164
|
+

|
165
|
+
|
166
|
+
|
167
|
+
And 4x:
|
168
|
+
|
169
|
+

|
170
|
+

|
171
|
+

|
172
|
+

|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
Let's try the second pack - that is, punks 100 to 199 in the series.
|
178
|
+
|
179
|
+
|
180
|
+

|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
Let's mint punk #0, #79, #80, and #90
|
185
|
+
and let's add an offset of 10100
|
186
|
+
(to start counting at 10000 plus 100 instead of 0):
|
187
|
+
|
188
|
+
```
|
189
|
+
$ punk 0 79 80 90 --file ./more-punks-2.png --offset 10100
|
190
|
+
```
|
191
|
+
|
192
|
+
printing:
|
193
|
+
|
194
|
+
```
|
195
|
+
==> reading >./more-punks-2.png<...
|
196
|
+
240x240 (height x width)
|
197
|
+
==> (1/4) minting punk #10100; writing to >./punk-10100.png<...
|
198
|
+
==> (2/4) minting punk #10179; writing to >./punk-10179.png<...
|
199
|
+
==> (3/4) minting punk #10180; writing to >./punk-10180.png<...
|
200
|
+
==> (4/4) minting punk #10190; writing to >./punk-10190.png<...
|
201
|
+
```
|
202
|
+
|
203
|
+
And voila! Super rare - world's first female alien and much more.
|
204
|
+
|
205
|
+
|
206
|
+

|
207
|
+

|
208
|
+

|
209
|
+

|
210
|
+
|
211
|
+
|
212
|
+
And 4x:
|
213
|
+
|
214
|
+

|
215
|
+

|
216
|
+

|
217
|
+

|
218
|
+
|
219
|
+
|
220
|
+
And so on.
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
120
229
|
## Usage in Your Scripts
|
121
230
|
|
122
231
|
|
data/lib/cryptopunks.rb
CHANGED
@@ -25,6 +25,7 @@ class Tool
|
|
25
25
|
opts = { zoom: 1,
|
26
26
|
outdir: '.',
|
27
27
|
file: './punks.png',
|
28
|
+
offset: 0,
|
28
29
|
}
|
29
30
|
|
30
31
|
parser = OptionParser.new do |cmd|
|
@@ -46,6 +47,9 @@ class Tool
|
|
46
47
|
opts[:file] = file
|
47
48
|
end
|
48
49
|
|
50
|
+
cmd.on("--offset=NUM", "Start counting at offset (default: #{opts[:offset]})", Integer ) do |offset|
|
51
|
+
opts[:offset] = offset
|
52
|
+
end
|
49
53
|
|
50
54
|
cmd.on("-h", "--help", "Prints this help") do
|
51
55
|
puts cmd
|
@@ -72,7 +76,7 @@ class Tool
|
|
72
76
|
|
73
77
|
punk = punks[ punk_index ]
|
74
78
|
|
75
|
-
punk_name
|
79
|
+
punk_name = "punk-" + "%04d" % (punk_index + opts[:offset])
|
76
80
|
|
77
81
|
## if zoom - add x2,x4 or such
|
78
82
|
if opts[:zoom] != 1
|
@@ -81,7 +85,7 @@ class Tool
|
|
81
85
|
end
|
82
86
|
|
83
87
|
path = "#{opts[:outdir]}/#{punk_name}.png"
|
84
|
-
puts "==> (#{index+1}/#{args.size}) minting punk ##{punk_index}; writing to >#{path}<..."
|
88
|
+
puts "==> (#{index+1}/#{args.size}) minting punk ##{punk_index+opts[:offset]}; writing to >#{path}<..."
|
85
89
|
|
86
90
|
punk.save( path )
|
87
91
|
end
|
@@ -8,9 +8,6 @@ module Cryptopunks
|
|
8
8
|
new( data )
|
9
9
|
end
|
10
10
|
|
11
|
-
PUNK_ROWS = 100
|
12
|
-
PUNK_COLS = 100
|
13
|
-
PUNK_COUNT = PUNK_ROWS * PUNK_COLS ## 10_000 = 100x100 (24000x24000 pixel)
|
14
11
|
|
15
12
|
PUNK_HEIGHT = 24
|
16
13
|
PUNK_WIDTH = 24
|
@@ -18,22 +15,19 @@ module Cryptopunks
|
|
18
15
|
PUNK_HASH = 'ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b'
|
19
16
|
|
20
17
|
|
21
|
-
|
22
18
|
def initialize( data )
|
23
19
|
@punks = ChunkyPNG::Image.from_blob( data )
|
24
20
|
puts " #{@punks.height}x#{@punks.width} (height x width)"
|
25
21
|
|
22
|
+
@punk_rows = @punks.width / PUNK_WIDTH ## e.g. 2400/24 = 100
|
23
|
+
@punk_cols = @punks.height / PUNK_HEIGHT ## e.g. 2400/24 = 100
|
24
|
+
@punk_count = @punk_rows * @punk_cols ## ## 10000 = 100x100 (2400x2400 pixel)
|
25
|
+
|
26
26
|
## check sha256 checksum
|
27
27
|
@hexdigest = sha256( data )
|
28
28
|
if original?
|
29
29
|
puts " >#{@hexdigest}< SHA256 hash matching"
|
30
30
|
puts " ✓ True Official Genuine CryptoPunks™ verified"
|
31
|
-
else
|
32
|
-
puts " !! ERROR: >#{hexdigest}< SHA256 hash NOT matching"
|
33
|
-
puts " >#{PUNK_HASH}< expected for True Official Genuine CryptoPunks™."
|
34
|
-
puts ""
|
35
|
-
puts " Sorry, please download the original."
|
36
|
-
exit 1
|
37
31
|
end
|
38
32
|
end
|
39
33
|
|
@@ -52,11 +46,11 @@ module Cryptopunks
|
|
52
46
|
|
53
47
|
|
54
48
|
|
55
|
-
def size()
|
49
|
+
def size() @punk_count; end
|
56
50
|
|
57
51
|
|
58
52
|
def punk( index )
|
59
|
-
y, x = index.divmod(
|
53
|
+
y, x = index.divmod( @punk_rows )
|
60
54
|
img = @punks.crop( x*PUNK_WIDTH, y*PUNK_HEIGHT, PUNK_WIDTH, PUNK_HEIGHT )
|
61
55
|
Pixelart::Image.new( img.width, img.height, img ) ## wrap in pixelart image
|
62
56
|
end
|
data/lib/cryptopunks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptopunks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|