Giter VIP home page Giter VIP logo

cl-isaac's People

Contributors

thephoeron avatar yitzchak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cl-isaac's Issues

The value -1 is not of type (UNSIGNED-BYTE 64) when setting slot CL-ISAAC::RANDCNT of structure CL-ISAAC:ISAAC64-CTX

Here is the backtrace:

 0: (CL-ISAAC:RAND64 #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(2607740593479640108 1120058785650815158 8433346093259028975 1544102133214792723 14805582337953662578 477957773971553510 ...) :RANDMEM #(7..
      Locals:
        CTX = #S(CL-ISAAC:ISAAC64-CTX ..)
 1: (CL-ISAAC:RAND-BITS-64 #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(2607740593479640108 1120058785650815158 8433346093259028975 1544102133214792723 14805582337953662578 477957773971553510 ...) :RANDM..
      Locals:
        CTX = #S(CL-ISAAC:ISAAC64-CTX ..)
        N = 160
 2: (LACK.UTIL:GENERATE-RANDOM-ID)

Lack uses Isaac for generating random IDs. And I use this utility function in some places inside Ultralisp. After the recent release it started to fail with the error.

cl-isaac was built at 2023-06-26 14:19:17 by Ultralisp.

Here is the content of isaac64-ctx:

RANDCNT: 0
A: 11884440134694905771
B: 17107183356821702559
C: 1025
RANDRSL:
#<(SIMPLE-ARRAY (UNSIGNED-BYTE 64) (256)) {1003751C5F}>
--------------------
Dimensions: (256)
Element type: (UNSIGNED-BYTE 64)
Total size: 256
Adjustable: NIL
Fill pointer: NIL
Contents:
0: 2607740593479640108
1: 1120058785650815158
2: 8433346093259028975
3: 1544102133214792723
4: 14805582337953662578
5: 477957773971553510
6: 4310681341902479877
7: 9289224603221215341
8: 12882306354141701221
9: 15867122008478062201
10: 8672753717236790856
11: 7424091142215692602
12: 8843143145999692987
13: 433280158655824341
14: 9643780247262169594
15: 13970236329049103763
16: 1792244838852008504
17: 1814894554999728111
18: 12765378110846378485
19: 12060975603861119746
20: 2022343250904850541
21: 479354026906615389
22: 12078846628481437154
23: 12320716372091132491
24: 14339031714587701137
25: 14283567128669607995
26: 16890559847029801306
27: 1331484746135441763
28: 18220737272728619745
29: 3801732329404658597
30: 10035506046174061068
31: 15398463778098626143
32: 8881611893310147097
33: 18028266068653175677
34: 6163984243205316964
35: 4920104524933213923
36: 10063705720684225684
37: 16568347248439644849
38: 12613896305956110787
39: 15465239744866407979
40: 5012117865316891420
41: 7217246517397434012
42: 5633587466726441545
43: 1261181207218850122
44: 13658190607975374929
45: 12453457893558990026
46: 8214520633117953637
47: 18101090569920452396
48: 10593279395163116449
49: 7946375502468521796
50: 16464717201161859312
51: 431751959011505042
52: 8883067456880109831
53: 12335448076282993332
54: 4255713259029101134
55: 10641421506237443978
56: 5011617960603501338
57: 182835446335493
58: 7506571623440456911
59: 18385044234736487538
60: 10639263440066061582
61: 253520061077454504
62: 9046969803666409223
63: 327728383834979509
64: 8323382025227831512
65: 3302039161607482100
66: 8145245165413997157
67: 9011017535135261145
68: 12452714215444523453
69: 6565381453294630742
70: 10801867570386557195
71: 12498391651591704061
72: 6101325955293866483
73: 12309528280528774551
74: 6824667513146407803
75: 5323740148658446730
76: 1306628137699973794
77: 11885606538257142661
78: 14657815595946593093
79: 9097737596403409425
80: 7407381700801094757
81: 1354991155782687592
82: 6927212292457485693
83: 11580666600993515614
84: 8760907938153298604
85: 6849864568711472388
86: 691771902183617332
87: 9009118150046256769
88: 3160490225061577555
89: 9926060177700470725
90: 5853196676433897005
91: 12709087431402381363
92: 6876789167371084022
93: 3640649921718356524
94: 976687269325286294
95: 4588298052994434506
96: 2976258991612158756
97: 2384167832319667635
98: 2069189527326399306
99: 2129382162655504037
100: 5021047902181054378
101: 18331496295124326579
102: 17221166604178993219
103: 14624324324324685846
104: 390633201412258959
105: 765039896565105080
106: 3308021097396434844
107: 17902745964170899223
108: 18016517786161794095
109: 15075710116722892635
110: 18178579510202942715
111: 6727800986926840468
112: 1848145699045343264
113: 535622288756915980
114: 17275607564726221731
115: 6544887594090418809
116: 7136017018864105652
117: 14429155242968005143
118: 4434026501187439495
119: 15661758205142270953
120: 15247995799146138653
121: 14300635993630894606
122: 13699853595355820401
123: 4317180446747681406
124: 14248889367675842044
125: 10735349492347778084
126: 11453171009531993427
127: 8173812739561959460
128: 3038153111373282839
129: 3864649608352251837
130: 425724002790489514
131: 16702785847994339687
132: 9247418353732719488
133: 14874183620767747790
134: 4507432968865235088
135: 14322256298257727843
136: 1565004810934553004
137: 15919760380823722192
138: 13330901291609311273
139: 15701599171911576465
140: 8412164219453077310
141: 15910209976448722219
142: 3105721415082822727
143: 55238471883184498
144: 9191445811088413557
145: 12621934978760640415
146: 15396018471222229863
147: 3813463701825017740
148: 17844324219358297421
149: 2160591618267509157
150: 15763288126641746482
151: 1769366631655144868
152: 9459895714522746948
153: 14006859470537488423
154: 18387007030466804268
155: 13202175409914204585
156: 5177265804987109749
157: 15695141025581557124
158: 2414017860509138716
159: 1974734516746714348
160: 17657883860943183579
161: 9282712549547247408
162: 1646412082857663572
163: 7790717471826145317
164: 12653985058033471688
165: 212842529547505081
166: 17314761487892824722
167: 3734949056252492718
168: 15088946219435828373
169: 13658290474915698907
170: 10374799133669931511
171: 11849030219243166510
172: 9818963226790624987
173: 7408723876923135173
174: 7909190897205630659
175: 604023512249559598
176: 16173225345842057711
177: 7411611698554479128
178: 3735609203986664320
179: 3066622284164333053
180: 8909272495864402136
181: 8896980565241943460
182: 11942946664977150324
183: 16333828824837289899
184: 3893104506101455292
185: 3865629189242623971
186: 10135087236395434199
187: 15166853530762756137
188: 1778195210209644658
189: 9534999569930747445
190: 10715907979737609545
191: 15651712691083578689
192: 10614702171623807130
193: 17113945969986120191
194: 2001033053105959186
195: 11791483036523644857
196: 841690084835400410
197: 9089232500541808429
198: 3365966741019890944
199: 7266190494187717873
200: 7288017855961236995
201: 3693156189801371961
202: 7534660840365977515
203: 9038351576558365575
204: 17592737091945549460
205: 9739551776693581463
206: 13556748521121309143
207: 15681898546525010370
208: 1840923924881228031
209: 10231874409701565372
210: 5338244915699913076
211: 9580628029098408618
212: 10096657426028027077
213: 7488998332859447747
214: 3465052106315611754
215: 17135624707179315366
216: 5527301863522451250
217: 2835159063231310705
218: 18156774090315819058
219: 1601187104565501814
220: 93072278574995350
221: 17654979399647733652
222: 10781821287747984699
223: 9790867772804768095
224: 13286564243883025360
225: 11774470572558089539
226: 4115303399114231451
227: 7894877658840391492
228: 1770074471826016968
229: 10650397516352499439
230: 3634096331073417872
231: 1642134174014009925
232: 5899744030496006126
233: 6133188447000124467
234: 13984686159621108206
235: 410080055546278173
236: 8372012442452697075
237: 3890365275090708002
238: 13731919739442175938
239: 8720048421660162137
240: 14392854544717028137
241: 16930425510605327698
242: 5356043518572385391
243: 2250319265529389326
244: 14302178857224083256
245: 3360654615773408658
246: 12029406885081075119
247: 7547013535595925730
248: 11883181949682984096
249: 5836471624126150955
250: 15480459830053030611
251: 12432465033074864172
252: 6979928030703933034
253: 7807875583779743539
254: 3930525366563026269
255: 17107183356821702559

RANDMEM:
#<(SIMPLE-ARRAY (UNSIGNED-BYTE 64) (256)) {100375246F}>
--------------------
Dimensions: (256)
Element type: (UNSIGNED-BYTE 64)
Total size: 256
Adjustable: NIL
Fill pointer: NIL
Contents:
0: 7829130724599791522
1: 9383885893822565469
2: 6445810709840408234
3: 5366459032483853327
4: 5962770348817867903
5: 4721358638798412174
6: 5697598046110172064
7: 613899508670468680
8: 10335287706350383248
9: 13065392944052751028
10: 14828911983811698403
11: 14537941757415451182
12: 11570309970429657256
13: 7206674259921228840
14: 6118508361582092710
15: 9823585557204114718
16: 18355002183305375012
17: 10679159729777984340
18: 8167659729960252345
19: 537008547955089664
20: 8133742575175753933
21: 14486266280866403487
22: 5762498497580212744
23: 4450838350206864625
24: 13809605520135413094
25: 8513126761668684094
26: 10425893865854673990
27: 3299386014361001395
28: 6163331599631935140
29: 18311720564370087912
30: 920127622401818783
31: 6491100254366819014
32: 1104663320216260669
33: 5928505176795743221
34: 17261935716894317798
35: 14190736171535252782
36: 7090553438777574221
37: 14006974736119252565
38: 9806638597778373934
39: 9678878603579409955
40: 16802693602487887114
41: 17956921431958412920
42: 16352207511581751542
43: 6191015292302419381
44: 12993403524285226957
45: 15688161739244252278
46: 12639129859409610984
47: 4207624881027522139
48: 12908064567121919489
49: 11699189703833228421
50: 17804164422632095883
51: 4691509796849239265
52: 14494379014387768824
53: 17048633780215338380
54: 8704739099683990229
55: 8803280744567297687
56: 10704454376991004350
57: 642899863174894559
58: 6623088382970764357
59: 3356743152436811861
60: 2332434589107411310
61: 3217408682712254747
62: 12531915891432466103
63: 16022650563918477514
64: 11508680056844873102
65: 18407759532219550861
66: 13232758075490360450
67: 9603883846619784569
68: 15522788846829749280
69: 10961774395913636104
70: 8839926281888862638
71: 7873715741162778034
72: 7575869970397933878
73: 3813112305336820886
74: 7853369137050591469
75: 1368562272178674465
76: 11456196905063971228
77: 14635903782797359846
78: 10108140357582758954
79: 15971042903905319943
80: 18420880431431392606
81: 3900591991922771309
82: 1368143357268614120
83: 2999308964529617177
84: 4809577392625429512
85: 10513690398736199786
86: 15664406204101028449
87: 17125544383949192019
88: 12072758481544373319
89: 13541468218159607564
90: 14242637341187717988
91: 2703587477090412686
92: 2656235819060029816
93: 9915354834422954264
94: 17797369088654787448
95: 11733324658586961713
96: 14822959786874821350
97: 1924633674790063765
98: 12896533416704658260
99: 7551749608833288271
100: 16670907448855459159
101: 4646526503982324108
102: 2750073113934913051
103: 8856633040634266324
104: 10749644294601176031
105: 287532651588783042
106: 6003401112958390223
107: 15591844872755554616
108: 17948569195164302016
109: 4230018707844585483
110: 16427284876737619243
111: 6833715230886780784
112: 10873411457468668871
113: 14413656320970542164
114: 14613658852861139526
115: 2176203833585063468
116: 10011602740882672457
117: 5844860815814556028
118: 8195665084022988285
119: 9628861986566288840
120: 3925498353978108943
121: 5868567599645464531
122: 6448877040717654258
123: 910875074602503178
124: 2956776154422655480
125: 17745412515431397749
126: 9564734028396303235
127: 17287159698271586654
128: 16881736924462485601
129: 2936363423502359823
130: 12495666866106733769
131: 14550373750326109232
132: 931596394818112792
133: 14145439643337372582
134: 9624159233878352952
135: 1872172771139778684
136: 7492174764135317957
137: 6419643521504349052
138: 3734710948954712406
139: 15107795369915770664
140: 13189787305052229784
141: 3508964813747463320
142: 6278994103706429594
143: 16187568997500081530
144: 16412403335485749999
145: 1013897181523053611
146: 18313732496378244118
147: 12734734757907448230
148: 12572960551482019923
149: 10970418866157594314
150: 17743619648934426401
151: 1673834975215822201
152: 17908078095802747806
153: 13040276662126255807
154: 17633196550031805023
155: 10405128765881643666
156: 15332604708458389685
157: 6645676610265721849
158: 10823306918933480774
159: 7511026748611973949
160: 4895017325639790168
161: 275172481345211874
162: 5044502019904352711
163: 1716085332775034373
164: 3895498982692412623
165: 14658823524124394814
166: 6951083173932088553
167: 6138902511652454880
168: 17682589996898373018
169: 6211932225418339192
170: 8149426987291983996
171: 1158570449973536348
172: 8737120326375754383
173: 10542382805276747046
174: 5246289243692603702
175: 2445671993919292929
176: 8117231427023827797
177: 818024473117998287
178: 9728304147268913200
179: 8060041197865397388
180: 1637595805603888622
181: 500227933993570529
182: 8528681974141822633
183: 13692992184989622862
184: 10124353279237978860
185: 15576202861858424383
186: 13457778323157679458
187: 12218765815687521655
188: 10303504178313591250
189: 10132932731559075254
190: 9308725734735017331
191: 5358900526801789347
192: 10056390430389973153
193: 11918509234191425600
194: 15724516131596437166
195: 12645275497809971272
196: 17859998285227780572
197: 65374401184858735
198: 15512125825358392573
199: 8271344224313019042
200: 6641581799878643024
201: 7143496874855627036
202: 7491591845513339181
203: 14760721255997049069
204: 17446086876516661083
205: 3206629374085717621
206: 17044488739572090492
207: 7365472217814401385
208: 2340417426124870419
209: 14181087390354178048
210: 13985127971755506486
211: 4566047577097335336
212: 16949961733492268287
213: 12947846680262907455
214: 17539169691826175416
215: 2073812853785352750
216: 80824198330956658
217: 17052167557428114607
218: 7932445842333647503
219: 13499538263383566356
220: 8894210945784934565
221: 14212850369766189651
222: 4533801972351830822
223: 15811625761859568854
224: 3153274017023467060
225: 17565064264523035976
226: 2743023480727314125
227: 14634235424440944327
228: 10983629653656137773
229: 5429646755315502562
230: 11221425661458261208
231: 5598952698094376868
232: 13067602413416296584
233: 1160824975325447836
234: 12099265780420721885
235: 2527882039945057672
236: 8475837086301673092
237: 1993268264287309097
238: 5653962324633373432
239: 474728261830265496
240: 16511730999418630655
241: 12929491217424124737
242: 6298386248524076989
243: 5007708313862457124
244: 8252798565386219770
245: 17164018110556996771
246: 14954043533586417990
247: 8524999970292769282
248: 13097165683203292015
249: 11054069510943467347
250: 2793152107830009297
251: 15831106295173264935
252: 15515798339463478318
253: 16041119782487627318
254: 13084315751415641185
255: 16632989974375930327

After I've reinitialized context like this:

CL-USER> (setf lack.util::*isaac-ctx*
               (isaac:init-self-seed :count 5
                                     :is64 #+:X86-64 t #-:X86-64 nil))

problem gone.

Self seed TYPE-ERROR

On a fresh Ubuntu 22.04.1 LTS with sbcl 2.2.9 compiled with --fancy

* (ql:quickload :cl-isaac)
To load "cl-isaac":
  Load 1 ASDF system:
    cl-isaac
; Loading "cl-isaac"

(:CL-ISAAC)
* (isaac:init-self-seed :is64 t)

debugger invoked on a TYPE-ERROR @53588C79 in thread
#<THREAD "main thread" RUNNING {10045E8253}>:
  The value
    10893305853531014082560
  is not of type
    (UNSIGNED-BYTE 64)

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(CL-ISAAC:GENERATE-NEXT-ISAAC64-BLOCK #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(16547972179494036899 9708444209684824475 8655519797196879704 14749124083405532485 6376240231094285444 18139667563087562089 14598417845439675695 16149493994076365071 15825376850622213781 16725646190253595372 15417830955150650585 1871938771190817803 ...) :RANDMEM #(16049801831406887843 7182649405026025239 7815722172752102265 17934961857329736960 10833401711503025226 9436644778462398273 4506268428565675060 7220563949238654772 7111204305939307881 8409880802846932020 11843726085848793366 7319015878117112450 ...) :A 2659498499397220235 :B 9708444209684824475 :C 1))
   source: (THE (UNSIGNED-BYTE 64)
                (ASH (ISAAC64-CTX-A CTX)
                     (ECASE (LOGAND I 3) ((0) 21) ((1) -5) ((2) 12) ((3) -33))))
0] 

How to output ASCII instead of Hexadecimal

Alright, I got a rudimentary password generator for 256 AES keys. It involves a quick bash script calling a .lisp file.

Here is the bash script:

#!/bin/bash
#sbcl options are to suppress output in order to just use script results, and quit after it's done
sbcl --noinform --noprint --disable-debugger --non-interactive --quit --load ~/scripts/passgen.lisp

Here is the lisp script:

;; suppress unnecessary output
(let* ((*standard-output* (make-broadcast-stream)) (*error-output* *standard-output*))
    (ql:quickload "cl-isaac"))

;; suppress unnecessary output
(let* ((*standard-output* (make-broadcast-stream)) (*error-output* *standard-output*))
    (defvar self-ctx (isaac:init-self-seed :count 3 :is64 t)))

(format t "~64,'0x" (isaac:rand-bits-64 self-ctx 256))

cl-isaac outputs in Hex (0x). How can I get the characters to come out as ASCII that includes lowercase letters, uppercase letters, symbol and numbers that you can type in as password characters?

INIT-SELF-SEED: invalid index

SBCL 2.2.9 on debian sid amd64, cl-isaac downloaded from current quicklisp dist.

CL-USER> (ql:quickload :cl-isaac)
To load "cl-isaac":
  Load 1 ASDF system:
    cl-isaac
; Loading "cl-isaac"

(:CL-ISAAC)
CL-USER> (isaac:init-self-seed :is64 t)

Invalid index 23781 for (SIMPLE-ARRAY (UNSIGNED-BYTE 64) (256)), should be a non-negative integer below 256.
   [Condition of type SB-INT:INVALID-ARRAY-INDEX-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10013E0143}>)

Backtrace:
  0: (CL-ISAAC:GENERATE-NEXT-ISAAC64-BLOCK #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(3934848528393097412 3139001632129883341 14599601752695088836 3102163498744780811 8279641599517826203 175449285896896..
      Locals:
        CTX = #S(CL-ISAAC:ISAAC64-CTX ..)
        I = 0
  1: (CL-ISAAC:SCRAMBLE64 #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(3934848528393097412 3139001632129883341 14599601752695088836 3102163498744780811 8279641599517826203 17544928589689641459 ...) :RANDM..
      Locals:
        A = 2294595384479959264
        B = 6784294260755478456
        C = 9559064695926442999
        CTX = #S(CL-ISAAC:ISAAC64-CTX ..)
        D = 9657017499224466276
        E = 16082990964643725320
        F = 18313416023109256564
        G = 5022560803070576583
        H = 13024515163114616408
  2: (CL-ISAAC:INIT-KERNEL-SEED :IS64 T)
      Locals:
        #:.DEFAULTING-TEMP. = T
        CTX = #S(CL-ISAAC:ISAAC64-CTX ..)
        IS64 = T
  3: (CL-ISAAC:INIT-SELF-SEED :COUNT 1 :IS64 T)
      Locals:
        #:.DEFAULTING-TEMP. = 1
        #:.DEFAULTING-TEMP.#1 = T
        ARRAY#1 = #(0 0 0 0 0 0 ...)
        COUNT = 1
        CTX = #S(CL-ISAAC:ISAAC64-CTX :RANDCNT 0 :RANDRSL #(0 0 0 0 0 0 ...) :RANDMEM #(0 0 0 0 0 0 ...) :A 0 :B 0 :C 0)
        I = 0
        SB-INT:INDEX = 0
        IS64 = T
        J = 0
        SB-C::Y = 1
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CL-ISAAC:INIT-SELF-SEED :IS64 T) #<NULL-LEXENV>)
  5: (EVAL (CL-ISAAC:INIT-SELF-SEED :IS64 T))
 --more--

Bad type specifiers

By default slot type checking is disabled on SBCL but enabled with safety 3. When enabled it shows bugs in your code.
Please refer to: #9
Would you be able to liberalize your types or correct the fact they are not what you expect?

Thanks.

Condition signalled initiating self seed

CL-USER> (ql:quickload :cl-isaac)
To load "cl-isaac":
  Load 1 ASDF system:
    cl-isaac
; Loading "cl-isaac"

(:CL-ISAAC)
CL-USER> (in-package :cl-isaac)
#<PACKAGE "CL-ISAAC">
ISAAC> (init-self-seed :is64 t)
; Debugger entered on #<SB-INT:INVALID-ARRAY-INDEX-ERROR expected-type: (INTEGER 0 (256)) datum: 41981>
[1] ISAAC> 

backtrace

Invalid index 41981 for (SIMPLE-ARRAY (UNSIGNED-BYTE 64) (256)), should be a non-negative integer below 256.
   [Condition of type SB-INT:INVALID-ARRAY-INDEX-ERROR]

Restarts:
 0: [RETRY] Retry SLY mREPL evaluation request.
 1: [*ABORT] Return to SLY's top level.
 2: [ABORT] abort thread (#<THREAD "sly-channel-1-mrepl-remote-1" RUNNING {100AC962B3}>)

Backtrace:
 0: (GENERATE-NEXT-ISAAC64-BLOCK #S(ISAAC64-CTX :RANDCNT 0 :RANDRSL #(935419330317120844 4361720847713160289 17134508137843955544 12276450597814484492 5733056363873583757 11868796555515008904 ...) :RANDME..
 1: (SCRAMBLE64 #S(ISAAC64-CTX :RANDCNT 0 :RANDRSL #(935419330317120844 4361720847713160289 17134508137843955544 12276450597814484492 5733056363873583757 11868796555515008904 ...) :RANDMEM #(4879904256235..
 2: (INIT-KERNEL-SEED :IS64 T)
 3: (INIT-SELF-SEED :COUNT 1 :IS64 T)
 4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (INIT-SELF-SEED :IS64 T) #<NULL-LEXENV>)
 5: (EVAL (INIT-SELF-SEED :IS64 T))
 6: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
 --more--

This is sbcl 2.2.0 on Linux

Error in 32 bit CCL on Windows

Steps to reproduce:

  1. Run ccl
  2. Load cl-isaac
  3. Evaluate `(cl-isaac:init-common-lisp-random-seed)

Here's my repl session:

; SLIME 2013-04-02
CL-USER> (ql:quickload :cl-isaac)
To load "cl-isaac":
  Load 1 ASDF system:
    cl-isaac
; Loading "cl-isaac"

(:CL-ISAAC)
CL-USER> (cl-isaac:init-common-lisp-random-seed)

and here's the error dump

The value 34950810361856 is not of the expected type (UNSIGNED-BYTE 32).
  [Condition of type TYPE-ERROR] 

 Restarts:
   0: [RETRY] Retry SLIME REPL evaluation request.
   1: [*ABORT] Return to SLIME's top level.
   2: [ABORT-BREAK] Reset this thread
   3: [ABORT] Kill this thread

Backtrace:
  0: (CL-ISAAC:GENERATE-NEXT-ISAAC-BLOCK #S(CL-ISAAC:ISAAC-CTX :RANDCNT 0 :RANDRSL #(4181815078 2982827587 2809737237 3507203205 2611067200 224360919 ...) :RANDMEM ...))
  1: (CL-ISAAC:SCRAMBLE #S(CL-ISAAC:ISAAC-CTX :RANDCNT 0 :RANDRSL #(4181815078 2982827587 2809737237 3507203205 2611067200 224360919 ...) :RANDMEM ...))
  2: (CCL::CALL-CHECK-REGS CL-ISAAC:INIT-COMMON-LISP-RANDOM-SEED)
  3: (CCL::CHEAP-EVAL (CL-ISAAC:INIT-COMMON-LISP-RANDOM-SEED))
  4: (SWANK::EVAL-REGION "(cl-isaac:init-common-lisp-random-seed)\n")
  5: ((:INTERNAL SWANK::REPL-EVAL))
  6: (SWANK::TRACK-PACKAGE #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::REPL-EVAL) #xCAEFC9E>)
  7: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::REPL-EVAL) #xCAEFCEE>)
  8: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::REPL-EVAL) #xCAEFD16>)
  9: (SWANK::REPL-EVAL "(cl-isaac:init-common-lisp-random-seed)\n")
 10: (CCL::CALL-CHECK-REGS SWANK:LISTENER-EVAL "(cl-isaac:init-common-lisp-random-seed)\n")
 11: (CCL::CHEAP-EVAL (SWANK:LISTENER-EVAL "(cl-isaac:init-common-lisp-random-seed)\n"))
 12: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL "(cl-isaac:init-common-lisp-random-seed)\n") "COMMON-LISP-USER" 7)
 13: (SWANK::PROCESS-REQUESTS NIL)
 14: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 15: ((:INTERNAL SWANK::HANDLE-REQUESTS))
 16: (SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK #<Compiled-function SWANK:SWANK-DEBUGGER-HOOK #xC96BD8E> #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::HANDLE-REQUESTS) #xCAB33A6>)
 17: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-OUTPUT* . #<SWANK-BACKEND::SLIME-OUTPUT-STREAM #xCAAA056>) (*STANDARD-INPUT* . #<SWANK-BACKEND::SLIME-INPUT-STREAM #xCAAA266>) ..))) #<COMPILED-LEXICAL-CLOSURE (..
 18: (SWANK::HANDLE-REQUESTS #<MULTITHREADED-CONNECTION #xC9B693E> NIL)
 19: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS repl-thread(12) [Active] #xCAAA516> (#<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xCAAA3CE>))
 20: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (PROCESS))) #<PROCESS repl-thread(12) [Active] #xCAAA516> (#<COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #xCAAA3CE>))
 21: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))

How can I script this? (Error: Too Many Dots?)

I got sbcl and quicklisp installed. The code works as instructed, but I cannot get it to script so I can call it from a bash script. I can load the script via sbcl --load script1.lisp, but it crashes after the first command.

Here are the contents of script1.lisp:

* (ql:quickload "cl-isaac")
...
* (defvar *self-ctx* (isaac:init-self-seed :count 3 :is64 t))
* (format nil "~64,'0x" (isaac:rand-bits-64 *self-ctx* 65536))

And here is the command and error:
[user1@computer ~]$ sbcl --load /home/user1/scripts/script1.lisp
This is SBCL 1.2.2, an implementation of ANSI Common Lisp.
More information about SBCL is available at http://www.sbcl.org/.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
To load "cl-isaac":
Load 1 ASDF system:
cl-isaac
; Loading "cl-isaac"

debugger invoked on a SB-C::INPUT-ERROR-IN-LOAD in thread

<THREAD "main thread" RUNNING {1002C166B3}>:

READ error during LOAD:

too many dots

  Line: 2, Column: 3, File-Position: 30

  Stream: #<SB-SYS:FD-STREAM for "file /home/user1/scripts/script1.lisp"
            {10044B87B3}>

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT ] Abort loading file "/home/user1/scripts/script1.lisp".
1: [CONTINUE] Ignore runtime option --load "/home/user1/scripts/script1.lisp".
2: Skip rest of --eval and --load options.
3: Skip to toplevel READ/EVAL/PRINT loop.
4: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).

(SB-C:COMPILER-ERROR SB-C::INPUT-ERROR-IN-LOAD :CONDITION #<SB-INT:SIMPLE-READER-ERROR "too many dots" {1004DE7633}> :STREAM #<SB-SYS:FD-STREAM for "file /home/user1/scripts/script1.lisp" {10044B87B3}>)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.