@bcts/seedtool-cli 1.0.0-alpha.14

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Base10 format
3
+ * Ported from seedtool-cli-rust/src/formats/base10.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { sha256DeterministicRandomString } from "../random.js";
10
+ import { dataToInts, digitsToData } from "../util.js";
11
+
12
+ /**
13
+ * Base-10 format handler.
14
+ * NOT round-trippable: input is entropy source.
15
+ * Digits 0-9 (compatible with https://iancoleman.io/bip39/).
16
+ */
17
+ export class Base10Format implements InputFormat, OutputFormat {
18
+ name(): string {
19
+ return "base10";
20
+ }
21
+
22
+ roundTrippable(): boolean {
23
+ return false;
24
+ }
25
+
26
+ processInput(state: Cli): Cli {
27
+ const input = state.expectInput();
28
+ // Syntax check only - validates that all characters are 0-9
29
+ digitsToData(input, 0, 9);
30
+ // Use SHA256 deterministic random to generate seed from input
31
+ const data = sha256DeterministicRandomString(input, state.count);
32
+ state.seed = Seed.new(data);
33
+ return state;
34
+ }
35
+
36
+ processOutput(state: Cli): string {
37
+ return dataToInts(state.expectSeed().data(), 0, 9, "");
38
+ }
39
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Base6 format
3
+ * Ported from seedtool-cli-rust/src/formats/base6.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { sha256DeterministicRandomString } from "../random.js";
10
+ import { dataToInts, digitsToData } from "../util.js";
11
+
12
+ /**
13
+ * Base-6 format handler.
14
+ * NOT round-trippable: input is entropy source.
15
+ * Digits 0-5 (compatible with https://iancoleman.io/bip39/).
16
+ */
17
+ export class Base6Format implements InputFormat, OutputFormat {
18
+ name(): string {
19
+ return "base6";
20
+ }
21
+
22
+ roundTrippable(): boolean {
23
+ return false;
24
+ }
25
+
26
+ processInput(state: Cli): Cli {
27
+ const input = state.expectInput();
28
+ // Syntax check only - validates that all characters are 0-5
29
+ digitsToData(input, 0, 5);
30
+ // Use SHA256 deterministic random to generate seed from input
31
+ const data = sha256DeterministicRandomString(input, state.count);
32
+ state.seed = Seed.new(data);
33
+ return state;
34
+ }
35
+
36
+ processOutput(state: Cli): string {
37
+ return dataToInts(state.expectSeed().data(), 0, 5, "");
38
+ }
39
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * BIP39 mnemonic format
3
+ * Ported from seedtool-cli-rust/src/formats/bip39.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { mnemonicToEntropy, entropyToMnemonic, validateMnemonic } from "@scure/bip39";
10
+ import { wordlist } from "@scure/bip39/wordlists/english";
11
+
12
+ /**
13
+ * BIP39 mnemonic format handler.
14
+ * Round-trippable: mnemonic → seed → mnemonic.
15
+ */
16
+ export class Bip39Format implements InputFormat, OutputFormat {
17
+ name(): string {
18
+ return "bip39";
19
+ }
20
+
21
+ roundTrippable(): boolean {
22
+ return true;
23
+ }
24
+
25
+ processInput(state: Cli): Cli {
26
+ const input = state.expectInput();
27
+ // Normalize the mnemonic (lowercase, single spaces)
28
+ const normalized = input.toLowerCase().trim().replace(/\s+/g, " ");
29
+
30
+ if (!validateMnemonic(normalized, wordlist)) {
31
+ throw new Error("Invalid BIP39 mnemonic");
32
+ }
33
+
34
+ const entropy = mnemonicToEntropy(normalized, wordlist);
35
+ state.seed = Seed.new(entropy);
36
+ return state;
37
+ }
38
+
39
+ processOutput(state: Cli): string {
40
+ const mnemonic = entropyToMnemonic(state.expectSeed().data(), wordlist);
41
+ return mnemonic;
42
+ }
43
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Bits format
3
+ * Ported from seedtool-cli-rust/src/formats/bits.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { sha256DeterministicRandomString } from "../random.js";
10
+ import { dataToInts, digitsToData } from "../util.js";
11
+
12
+ /**
13
+ * Binary format handler.
14
+ * NOT round-trippable: input is entropy source.
15
+ * Bits 0-1 (compatible with https://iancoleman.io/bip39/).
16
+ */
17
+ export class BitsFormat implements InputFormat, OutputFormat {
18
+ name(): string {
19
+ return "bits";
20
+ }
21
+
22
+ roundTrippable(): boolean {
23
+ return false;
24
+ }
25
+
26
+ processInput(state: Cli): Cli {
27
+ const input = state.expectInput();
28
+ // Syntax check only - validates that all characters are 0-1
29
+ digitsToData(input, 0, 1);
30
+ // Use SHA256 deterministic random to generate seed from input
31
+ const data = sha256DeterministicRandomString(input, state.count);
32
+ state.seed = Seed.new(data);
33
+ return state;
34
+ }
35
+
36
+ processOutput(state: Cli): string {
37
+ return dataToInts(state.expectSeed().data(), 0, 1, "");
38
+ }
39
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Bytewords Minimal format
3
+ * Ported from seedtool-cli-rust/src/formats/bytewords_minimal.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { encodeBytewords, decodeBytewords, BytewordsStyle } from "@bcts/uniform-resources";
10
+
11
+ /**
12
+ * Bytewords Minimal format handler.
13
+ * Round-trippable: bytewords → seed → bytewords.
14
+ * Uses 2-letter abbreviations without separators.
15
+ */
16
+ export class BytewordsMinimalFormat implements InputFormat, OutputFormat {
17
+ name(): string {
18
+ return "btwm";
19
+ }
20
+
21
+ roundTrippable(): boolean {
22
+ return true;
23
+ }
24
+
25
+ processInput(state: Cli): Cli {
26
+ const input = state.expectInput();
27
+ const data = decodeBytewords(input, BytewordsStyle.Minimal);
28
+ state.seed = Seed.new(data);
29
+ return state;
30
+ }
31
+
32
+ processOutput(state: Cli): string {
33
+ return encodeBytewords(state.expectSeed().data(), BytewordsStyle.Minimal);
34
+ }
35
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Bytewords Standard format
3
+ * Ported from seedtool-cli-rust/src/formats/bytewords_standard.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { encodeBytewords, decodeBytewords, BytewordsStyle } from "@bcts/uniform-resources";
10
+
11
+ /**
12
+ * Bytewords Standard format handler.
13
+ * Round-trippable: bytewords → seed → bytewords.
14
+ * Uses full words separated by spaces.
15
+ */
16
+ export class BytewordsStandardFormat implements InputFormat, OutputFormat {
17
+ name(): string {
18
+ return "btw";
19
+ }
20
+
21
+ roundTrippable(): boolean {
22
+ return true;
23
+ }
24
+
25
+ processInput(state: Cli): Cli {
26
+ const input = state.expectInput();
27
+ const data = decodeBytewords(input, BytewordsStyle.Standard);
28
+ state.seed = Seed.new(data);
29
+ return state;
30
+ }
31
+
32
+ processOutput(state: Cli): string {
33
+ return encodeBytewords(state.expectSeed().data(), BytewordsStyle.Standard);
34
+ }
35
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Bytewords URI format
3
+ * Ported from seedtool-cli-rust/src/formats/bytewords_uri.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { encodeBytewords, decodeBytewords, BytewordsStyle } from "@bcts/uniform-resources";
10
+
11
+ /**
12
+ * Bytewords URI format handler.
13
+ * Round-trippable: bytewords → seed → bytewords.
14
+ * Uses full words separated by hyphens (URI-safe).
15
+ */
16
+ export class BytewordsUriFormat implements InputFormat, OutputFormat {
17
+ name(): string {
18
+ return "btwu";
19
+ }
20
+
21
+ roundTrippable(): boolean {
22
+ return true;
23
+ }
24
+
25
+ processInput(state: Cli): Cli {
26
+ const input = state.expectInput();
27
+ const data = decodeBytewords(input, BytewordsStyle.Uri);
28
+ state.seed = Seed.new(data);
29
+ return state;
30
+ }
31
+
32
+ processOutput(state: Cli): string {
33
+ return encodeBytewords(state.expectSeed().data(), BytewordsStyle.Uri);
34
+ }
35
+ }
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Cards format
3
+ * Ported from seedtool-cli-rust/src/formats/cards.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { deterministicRandom } from "../random.js";
10
+ import { dataToAlphabet } from "../util.js";
11
+
12
+ // Arrangement of cards per:
13
+ // https://github.com/iancoleman/bip39/blob/master/src/js/entropy.js
14
+ const CARD_SUITS = "cdhs";
15
+ const CARD_RANKS = "a23456789tjqk";
16
+
17
+ /**
18
+ * Parse a card rank character.
19
+ * Returns index 0-12.
20
+ */
21
+ function parseRank(c: string): number {
22
+ const lower = c.toLowerCase();
23
+ const index = CARD_RANKS.indexOf(lower);
24
+ if (index === -1) {
25
+ throw new Error(`Invalid card rank: ${c}. Allowed: [A,2-9,T,J,Q,K]`);
26
+ }
27
+ return index;
28
+ }
29
+
30
+ /**
31
+ * Parse a card suit character.
32
+ * Returns index 0-3.
33
+ */
34
+ function parseSuit(c: string): number {
35
+ const lower = c.toLowerCase();
36
+ const index = CARD_SUITS.indexOf(lower);
37
+ if (index === -1) {
38
+ throw new Error(`Invalid card suit: ${c}. Allowed: [C,D,H,S]`);
39
+ }
40
+ return index;
41
+ }
42
+
43
+ /**
44
+ * Convert card string to byte array.
45
+ * Each pair of characters represents one card.
46
+ */
47
+ function cardsToData(cards: string): Uint8Array {
48
+ const len = cards.length;
49
+ if (len % 2 !== 0) {
50
+ throw new Error("Cards string must have even number of characters.");
51
+ }
52
+ const count = len / 2;
53
+ const result = new Uint8Array(count);
54
+ for (let i = 0; i < count; i++) {
55
+ const rank = parseRank(cards[i * 2]);
56
+ const suit = parseSuit(cards[i * 2 + 1]);
57
+ const n = suit * 13 + rank;
58
+ result[i] = n;
59
+ }
60
+ return result;
61
+ }
62
+
63
+ /**
64
+ * Convert a card index (0-51) to card string.
65
+ */
66
+ function toCard(n: number): string {
67
+ if (n > 51) {
68
+ throw new Error(`Card index out of range: ${n}`);
69
+ }
70
+ const rank = n % 13;
71
+ const suit = Math.floor(n / 13);
72
+ return CARD_RANKS[rank] + CARD_SUITS[suit];
73
+ }
74
+
75
+ /**
76
+ * Playing cards format handler.
77
+ * NOT round-trippable: input is entropy source.
78
+ * Card notation: rank (A,2-9,T,J,Q,K) + suit (C,D,H,S).
79
+ */
80
+ export class CardsFormat implements InputFormat, OutputFormat {
81
+ name(): string {
82
+ return "cards";
83
+ }
84
+
85
+ roundTrippable(): boolean {
86
+ return false;
87
+ }
88
+
89
+ processInput(state: Cli): Cli {
90
+ const input = state.expectInput();
91
+ const entropy = cardsToData(input);
92
+ const data = deterministicRandom(entropy, state.count);
93
+ state.seed = Seed.new(data);
94
+ return state;
95
+ }
96
+
97
+ processOutput(state: Cli): string {
98
+ return dataToAlphabet(state.expectSeed().data(), 52, toCard);
99
+ }
100
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Dice format
3
+ * Ported from seedtool-cli-rust/src/formats/dice.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { sha256DeterministicRandomString } from "../random.js";
10
+ import { dataToInts, digitsToData } from "../util.js";
11
+
12
+ /**
13
+ * Dice roll format handler.
14
+ * NOT round-trippable: input is entropy source.
15
+ * Digits 1-6 (compatible with https://iancoleman.io/bip39/).
16
+ */
17
+ export class DiceFormat implements InputFormat, OutputFormat {
18
+ name(): string {
19
+ return "dice";
20
+ }
21
+
22
+ roundTrippable(): boolean {
23
+ return false;
24
+ }
25
+
26
+ processInput(state: Cli): Cli {
27
+ const input = state.expectInput();
28
+ // Syntax check only - validates that all characters are 1-6
29
+ digitsToData(input, 1, 6);
30
+ // Use SHA256 deterministic random to generate seed from input
31
+ const data = sha256DeterministicRandomString(input, state.count);
32
+ state.seed = Seed.new(data);
33
+ return state;
34
+ }
35
+
36
+ processOutput(state: Cli): string {
37
+ return dataToInts(state.expectSeed().data(), 1, 6, "");
38
+ }
39
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Envelope format
3
+ * Ported from seedtool-cli-rust/src/formats/envelope.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { Envelope } from "@bcts/envelope";
10
+
11
+ /**
12
+ * Gordian Envelope format handler.
13
+ * Round-trippable: envelope UR → seed → envelope UR.
14
+ */
15
+ export class EnvelopeFormat implements InputFormat, OutputFormat {
16
+ name(): string {
17
+ return "envelope";
18
+ }
19
+
20
+ roundTrippable(): boolean {
21
+ return true;
22
+ }
23
+
24
+ processInput(state: Cli): Cli {
25
+ const input = state.expectInput();
26
+ const envelope = Envelope.fromURString(input);
27
+ state.seed = Seed.fromEnvelope(envelope);
28
+ return state;
29
+ }
30
+
31
+ processOutput(state: Cli): string {
32
+ return state.toEnvelope().urString();
33
+ }
34
+ }
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Format traits and factory functions
3
+ * Ported from seedtool-cli-rust/src/formats/format.rs
4
+ */
5
+
6
+ import type { Cli, InputFormatKey, OutputFormatKey } from "../cli.js";
7
+
8
+ // ============================================================================
9
+ // Format Interfaces (Traits)
10
+ // ============================================================================
11
+
12
+ /**
13
+ * Base format interface.
14
+ * Matches Rust Format trait.
15
+ */
16
+ export interface Format {
17
+ /** Get the format name */
18
+ name(): string;
19
+ /** Whether this format supports round-trip conversion */
20
+ roundTrippable(): boolean;
21
+ }
22
+
23
+ /**
24
+ * Input format interface.
25
+ * Matches Rust InputFormat trait.
26
+ */
27
+ export interface InputFormat extends Format {
28
+ /** Process input and update CLI state with seed */
29
+ processInput(state: Cli): Cli;
30
+ }
31
+
32
+ /**
33
+ * Output format interface.
34
+ * Matches Rust OutputFormat trait.
35
+ */
36
+ export interface OutputFormat extends Format {
37
+ /** Process seed from CLI state and return output string */
38
+ processOutput(state: Cli): string;
39
+ }
40
+
41
+ // ============================================================================
42
+ // Format Factory Functions
43
+ // ============================================================================
44
+
45
+ // Import formats (will be implemented in subsequent files)
46
+ import { HexFormat } from "./hex.js";
47
+ import { Bip39Format } from "./bip39.js";
48
+ import { SSKRFormat } from "./sskr.js";
49
+ import { EnvelopeFormat } from "./envelope.js";
50
+ import { SeedFormat } from "./seed-format.js";
51
+ import { MultipartFormat } from "./multipart.js";
52
+ import { RandomFormat } from "./random.js";
53
+ import { Base6Format } from "./base6.js";
54
+ import { Base10Format } from "./base10.js";
55
+ import { BitsFormat } from "./bits.js";
56
+ import { DiceFormat } from "./dice.js";
57
+ import { CardsFormat } from "./cards.js";
58
+ import { IntsFormat } from "./ints.js";
59
+ import { BytewordsStandardFormat } from "./bytewords-standard.js";
60
+ import { BytewordsMinimalFormat } from "./bytewords-minimal.js";
61
+ import { BytewordsUriFormat } from "./bytewords-uri.js";
62
+
63
+ /**
64
+ * Select input format by key.
65
+ * Matches Rust select_input_format function.
66
+ */
67
+ export function selectInputFormat(key: InputFormatKey): InputFormat {
68
+ switch (key) {
69
+ case "random":
70
+ return new RandomFormat();
71
+ case "hex":
72
+ return new HexFormat();
73
+ case "btw":
74
+ return new BytewordsStandardFormat();
75
+ case "btwu":
76
+ return new BytewordsUriFormat();
77
+ case "btwm":
78
+ return new BytewordsMinimalFormat();
79
+ case "bits":
80
+ return new BitsFormat();
81
+ case "cards":
82
+ return new CardsFormat();
83
+ case "dice":
84
+ return new DiceFormat();
85
+ case "base6":
86
+ return new Base6Format();
87
+ case "base10":
88
+ return new Base10Format();
89
+ case "ints":
90
+ return new IntsFormat();
91
+ case "bip39":
92
+ return new Bip39Format();
93
+ case "sskr":
94
+ return new SSKRFormat();
95
+ case "envelope":
96
+ return new EnvelopeFormat();
97
+ case "multipart":
98
+ return new MultipartFormat();
99
+ case "seed":
100
+ return new SeedFormat();
101
+ default:
102
+ throw new Error(`Unknown input format: ${key}`);
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Select output format by key.
108
+ * Matches Rust select_output_format function.
109
+ */
110
+ export function selectOutputFormat(key: OutputFormatKey): OutputFormat {
111
+ switch (key) {
112
+ case "hex":
113
+ return new HexFormat();
114
+ case "btw":
115
+ return new BytewordsStandardFormat();
116
+ case "btwu":
117
+ return new BytewordsUriFormat();
118
+ case "btwm":
119
+ return new BytewordsMinimalFormat();
120
+ case "bits":
121
+ return new BitsFormat();
122
+ case "cards":
123
+ return new CardsFormat();
124
+ case "dice":
125
+ return new DiceFormat();
126
+ case "base6":
127
+ return new Base6Format();
128
+ case "base10":
129
+ return new Base10Format();
130
+ case "ints":
131
+ return new IntsFormat();
132
+ case "bip39":
133
+ return new Bip39Format();
134
+ case "sskr":
135
+ return new SSKRFormat();
136
+ case "envelope":
137
+ return new EnvelopeFormat();
138
+ case "multipart":
139
+ return new MultipartFormat();
140
+ case "seed":
141
+ return new SeedFormat();
142
+ default:
143
+ throw new Error(`Unknown output format: ${key}`);
144
+ }
145
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Hex format
3
+ * Ported from seedtool-cli-rust/src/formats/hex.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { hexToData, dataToHex } from "../util.js";
10
+
11
+ /**
12
+ * Hexadecimal format handler.
13
+ * Round-trippable: hex → seed → hex.
14
+ */
15
+ export class HexFormat implements InputFormat, OutputFormat {
16
+ name(): string {
17
+ return "hex";
18
+ }
19
+
20
+ roundTrippable(): boolean {
21
+ return true;
22
+ }
23
+
24
+ processInput(state: Cli): Cli {
25
+ const input = state.expectInput();
26
+ const seed = Seed.new(hexToData(input));
27
+ state.seed = seed;
28
+ return state;
29
+ }
30
+
31
+ processOutput(state: Cli): string {
32
+ return dataToHex(state.expectSeed().data());
33
+ }
34
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Format exports
3
+ * Ported from seedtool-cli-rust/src/formats/mod.rs
4
+ */
5
+
6
+ // Re-export format traits and utilities
7
+ export {
8
+ type Format,
9
+ type InputFormat,
10
+ type OutputFormat,
11
+ selectInputFormat,
12
+ selectOutputFormat,
13
+ } from "./format.js";
14
+
15
+ // Re-export individual formats
16
+ export { Base6Format } from "./base6.js";
17
+ export { Base10Format } from "./base10.js";
18
+ export { Bip39Format } from "./bip39.js";
19
+ export { BitsFormat } from "./bits.js";
20
+ export { BytewordsMinimalFormat } from "./bytewords-minimal.js";
21
+ export { BytewordsUriFormat } from "./bytewords-uri.js";
22
+ export { BytewordsStandardFormat } from "./bytewords-standard.js";
23
+ export { CardsFormat } from "./cards.js";
24
+ export { DiceFormat } from "./dice.js";
25
+ export { HexFormat } from "./hex.js";
26
+ export { IntsFormat } from "./ints.js";
27
+ export { RandomFormat } from "./random.js";
28
+ export { SSKRFormat } from "./sskr.js";
29
+ export { EnvelopeFormat } from "./envelope.js";
30
+ export { SeedFormat } from "./seed-format.js";
31
+ export { MultipartFormat } from "./multipart.js";
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Ints format
3
+ * Ported from seedtool-cli-rust/src/formats/ints.rs
4
+ */
5
+
6
+ import type { Cli } from "../cli.js";
7
+ import type { InputFormat, OutputFormat } from "./format.js";
8
+ import { Seed } from "../seed.js";
9
+ import { deterministicRandom } from "../random.js";
10
+ import { dataToInts, parseInts } from "../util.js";
11
+
12
+ /**
13
+ * Integer list format handler.
14
+ * NOT round-trippable: input is entropy source.
15
+ * Configurable range via --low and --high CLI options.
16
+ */
17
+ export class IntsFormat implements InputFormat, OutputFormat {
18
+ name(): string {
19
+ return "ints";
20
+ }
21
+
22
+ roundTrippable(): boolean {
23
+ return false;
24
+ }
25
+
26
+ processInput(state: Cli): Cli {
27
+ const input = state.expectInput();
28
+ const entropy = parseInts(input);
29
+ const data = deterministicRandom(entropy, state.count);
30
+ state.seed = Seed.new(data);
31
+ return state;
32
+ }
33
+
34
+ processOutput(state: Cli): string {
35
+ return dataToInts(state.expectSeed().data(), state.low, state.high, " ");
36
+ }
37
+ }