fork download
  1. <?php
  2.  
  3. // openssl dh -in <(openssl gendh 36) -noout -C | sed '2!d;s/0x//g;s/,//g'
  4. // add more bits for more privacy, use letters in the display id for
  5. // compactness (avoid homoglyphs, e.g. l & i, and if you're doing phone stuff,
  6. // consider avoiding close homophones, e.g. b, v, & p)
  7. $safe_prime = gmp_init("0x8C3586263");
  8. $generator = gmp_init("2");
  9. // openssl rand -hex 5
  10. $seed = gmp_init("0x8d387ccc7f");
  11. $pad_len = strlen(gmp_strval($safe_prime));
  12.  
  13. for ($row_id = 1; $row_id <= 256; $row_id++)
  14. {
  15. $id = gmp_powm($generator, gmp_add($seed, gmp_init($row_id)), $safe_prime);
  16. $display_id = str_pad(gmp_strval($id), $pad_len, "0", STR_PAD_LEFT);
  17.  
  18. echo $display_id."\n";
  19. }
  20.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
03967101698
07934203396
15868406792
31736813584
25836539325
14035990807
28071981614
18506875385
37013750770
36390413697
35143739551
32650391259
27663694675
17690301507
35380603014
33124118185
28611148527
19585209211
01533330579
03066661158
06133322316
12266644632
24533289264
11429490685
22858981370
08080874897
16161749794
32323499588
27009911333
16382734823
32765469646
27893851449
18150615055
36301230110
34965372377
32293656911
26950225979
16263364115
32526728230
27416368617
17195649391
34391298782
31145509721
24653931599
11670775355
23341550710
09046013577
18092027154
36184054308
34731020773
31824953703
26012819563
14388551283
28777102566
19917117289
02197146735
04394293470
08788586940
17577173880
35154347760
32671607677
27706127511
17775167179
35550334358
33463580873
29290073903
20943059963
04249032083
08498064166
16996128332
33992256664
30347425485
23057763127
08478438411
16956876822
33913753644
30190419445
22743751047
07850414251
15700828502
31401657004
25166226165
12695364487
25390728974
13144370105
26288740210
14940392577
29880785154
22124482465
06611877087
13223754174
26447508348
15257928853
30515857706
23394627569
09152167295
18304334590
36608669180
35580250517
33523413191
29409738539
21182389235
04727690627
09455381254
18910762508
00184437173
00368874346
00737748692
01475497384
02950994768
05901989536
11803979072
23607958144
09578828445
19157656890
00678225937
01356451874
02712903748
05425807496
10851614992
21703229984
05769372125
11538744250
23077488500
08517889157
17035778314
34071556628
30506025413
23374962983
09112838123
18225676246
36451352492
35265617141
32894146439
28151205035
18665322227
37330644454
37024201065
36411314287
35185540731
32733993619
27830899395
18024710947
36049421894
34461755945
31286424047
24935760251
12234432659
24468865318
11300642793
22601285586
07565483329
15130966658
30261933316
22886778789
08136469735
16272939470
32545878940
27454670037
17272252231
34544504462
31451921081
25266754319
12896420795
25792841590
13948595337
27897190674
18157293505
36314587010
34992086177
32347084511
27057081179
16477074515
32954149030
28271210217
18905332591
00173577339
00347154678
00694309356
01388618712
02777237424
05554474848
11108949696
22217899392
06798710941
13597421882
27194843764
16752599685
33505199370
29373310897
21109533951
04581980059
09163960118
18327920236
36655840472
35674593101
33712098359
29787108875
21937129907
06237171971
12474343942
24948687884
12260287925
24520575850
11404063857
22808127714
07979167585
15958335170
31916670340
26196252837
14755417831
29510835662
21384583481
05132079119
10264158238
20528316476
03419545109
06839090218
13678180436
27356360872
17075633901
34151267802
30665447761
23693807679
09750527515
19501055030
01365022217
02730044434
05460088868
10920177736
21840355472
06043623101
12087246202
24174492404
10711896965
21423793930
05210500017
10421000034
20842000068
04046912293
08093824586
16187649172
32375298344
27113508845
16589929847
33179859694
28722631545
19808175247
01979262651
03958525302
07917050604
15834101208
31668202416
25699316989
13761546135
27523092270