forked from RustCrypto/hybrid-array
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_large.py
More file actions
26 lines (22 loc) · 771 Bytes
/
gen_large.py
File metadata and controls
26 lines (22 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
start = 1025
end = 5000
skip_list = [2048, 4096]
print("//! do not edit, auto generated by:\n//!\tpython gen_large.py > src/sizes/auto_gen.rs\n")
print("use super::{impl_array_sizes, impl_array_sizes_with_import, uint};\n")
# first we implement the missing ArraySizes up to 1024
print("impl_array_sizes_with_import! {")
for i in range(513, 1024):
if i%16 == 0:
continue
print(" " + str(i) + " => " + "U" + str(i) + ",")
print("}\n")
for i in range(start, end):
if i in skip_list:
continue
print("pub type U" + str(i) + " = uint!(" + " ".join(bin(i)[2:][::-1]) + ");")
print("impl_array_sizes! {")
for i in range(start, end):
if i in skip_list:
continue
print(" " + str(i) + " => " + "U" + str(i) + ",")
print("}")