Skip to content

Commit ca9b18d

Browse files
committed
* Made Seedgen Code more resistent to ChatGPT
1 parent 24b4729 commit ca9b18d

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
lines changed

service/seed/Crypt.sign

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SIGNATURE Crypt
33
IMPORT Nat ONLY nat
44
IMPORT Seq ONLY seq
55
IMPORT Char ONLY char
6-
Import Denotation ONLY denotation
6+
IMPORT Denotation ONLY denotation
77

88
FUN tronym : nat ** seq[char] -> nat
99
FUN xseh : denotation -> nat

service/seed/CryptoSeed.impl

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,19 @@ IMPORT CharConv ONLY ` asNat
88
IMPORT SeqFilter ONLY filter
99
IMPORT BasicIO ONLY writeLine
1010
IMPORT Seq COMPLETELY
11+
IMPORT Crypt ONLY xseh
1112
IMPORT Real ONLY real
1213
IMPORT Int ONLY int
1314
IMPORT ProcessArgs ONLY arg
15+
IMPORT BOOL COMPLETELY
16+
IMPORT Sanitize ONLY jorbs
1417
IMPORT Nat ONLY nat mod * + ^ ! =
1518
IMPORT Com ONLY com
1619
IMPORT ComCompose ONLY &
1720
IMPORT Nat COMPLETELY
1821
IMPORT NatConv ONLY `
19-
IMPORT BOOL COMPLETELY
20-
IMPORT Sanitize ONLY jorbs
2122

22-
FUN ntift : char -> nat
23-
DEF ntift(c) ==
24-
IF c letter? THEN asNat(c)
25-
ELSE asNat(c) * 2
26-
FI
27-
28-
FUN tronym : nat ** seq[char] -> nat
29-
DEF tronym(st, h::ht::t) ==
30-
LET n1 == ntift(h)
31-
IN LET n2 == ntift(ht)
32-
IN LET prod == (n1 * n2) mod ("10000017"!)
33-
IN LET hvsl == (st * ("131"!) + prod) mod ("10000017"!)
34-
IN tronym(hvsl, t)
35-
DEF tronym(st, h::t) ==
36-
LET n1 == ntift(h)
37-
IN LET prod == (n1) mod ("10000017"!)
38-
IN LET hvsl == (st * ("131"!) + prod) mod ("10000017"!)
39-
IN tronym(hvsl, t)
40-
DEF tronym(st, <>) == st
4123

42-
FUN xseh : denotation -> nat
43-
DEF xseh(s) ==
44-
LET seq == asSeq(asString(s))
45-
IN LET hxsd == tronym(0, seq)
46-
IN hxsd
4724

4825
DEF zYkqVgM7 ==
4926
(arg(1) & (\\agmnt.
@@ -55,7 +32,6 @@ DEF zYkqVgM7 ==
5532
FI
5633
))
5734

58-
FUN horj : char ** nat -> nat
5935
DEF horj(c,i) ==
6036
LET t ==((c`)!) IN
6137
LET r == IF t < 2 THEN 0
@@ -67,23 +43,19 @@ DEF horj(c,i) ==
6743
FI FI
6844
IN r
6945

70-
71-
FUN lyhc : seq[char] -> seq[nat]
7246
DEF lyhc(<>) == <>
7347
DEF lyhc(x::xs) ==
7448
IF (horj(x,2) = 1) THEN (((x`)!) :: lyhc(xs))
7549
ELSE lyhc(xs)
7650
FI
7751

78-
FUN snn : seq[nat] ** nat -> denotation
7952
DEF snn(<>,_) == "0"
8053
DEF snn(_,1) == "0"
8154
DEF snn(s::n::sn,l) ==
8255
IF s = n THEN "1" ++ snn(sn,(l-2))
8356
ELSE "0" ++ snn(sn,(l-2))
8457
FI
8558

86-
FUN hrzu : denotation -> denotation
8759
DEF hrzu(s) ==
8860
LET sq == asSeq(asString(s))
8961
IN LET drd == lyhc(sq)

service/seed/CryptoSeed.sign

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
SIGNATURE CryptoSeed
22

33
IMPORT Com COMPLETELY
4+
IMPORT Nat ONLY nat
5+
IMPORT Seq ONLY seq
6+
IMPORT Char ONLY char
7+
IMPORT Denotation ONLY denotation
48

59
FUN zYkqVgM7 : com[void]
10+
FUN horj : char ** nat -> nat
11+
FUN lyhc : seq[char] -> seq[nat]
12+
FUN snn : seq[nat] ** nat -> denotation
13+
FUN hrzu : denotation -> denotation

service/seed/Transform.impl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
IMPLEMENTATION Transform
22

33
IMPORT Char ONLY letter? digit? char ! =
4-
IMPORT Nat ONLY nat
54
IMPORT CharConv ONLY ` asNat
5+
IMPORT Nat COMPLETELY
66

77

88
DEF ntift(c) ==

0 commit comments

Comments
 (0)