BC-Seedtool-CLI TypeScript Library - v1.0.0-alpha.16
    Preparing search index...

    Class Cli

    CLI state and configuration. Matches Rust Cli struct.

    Index

    Constructors

    Properties

    input?: string

    The input to be transformed. If required and not present, will be read from stdin.

    count: number = 16

    The number of output units (hex bytes, base-10 digits, etc.)

    in: InputFormatKey = InputFormatKey.Random

    The input format. Default: Random

    out: OutputFormatKey = OutputFormatKey.Hex

    The output format. Default: Hex

    low: number = 0

    The lowest int returned (0-254). Default: 0

    high: number = 9

    The highest int returned (1-255), low < high. Default: 9

    name?: string

    The name of the seed.

    note?: string

    The note associated with the seed.

    date?: Date

    The seed's creation date, in ISO-8601 format. May also be now.

    maxFragmentLen: number = 500

    For multipart output, max fragment length. Default: 500

    additionalParts: number = 0

    For multipart output, additional parts for fountain encoding. Default: 0

    groups: GroupSpec[] = []

    Group specifications for SSKR.

    groupThreshold: number = 1

    The number of groups that must meet their threshold. Default: 1

    sskrFormat: SSKRFormatKey = SSKRFormatKey.Envelope

    SSKR output format. Default: Envelope

    deterministic?: string

    Deterministic RNG seed string.

    seed?: Seed

    The seed being processed (internal state).

    rng?: RngSource

    The RNG source (internal state).

    Methods

    • Get input from argument or read from stdin. Matches Rust expect_input method.

      Returns string

    • Get input from argument or read from stdin asynchronously. This is the async version for actual CLI use.

      Returns Promise<string>

    • Get the seed, throwing if not initialized. Matches Rust expect_seed method.

      Returns Seed

    • Generate random data using the configured RNG. Matches Rust random_data method.

      Parameters

      • size: number

      Returns Uint8Array

    • Get the seed with CLI overrides applied (name, note, date). Matches Rust seed_with_overrides method.

      Returns Seed

    • Convert the seed (with overrides) to an Envelope. Matches Rust to_envelope method.

      Returns Envelope$1

    • Build SSKR spec from CLI options. Matches Rust sskr_spec method.

      Returns Spec