API reference
These pages are generated from the SDK source metadata and are the precise contract for each public declaration.
- ErrorCode — ErrorCode is stable across the Go and TypeScript SDKs.
- InvalidSeedLength — InvalidSeedLength is a public MasterSeed Go SDK constants.
- InvalidHashEncoding — InvalidHashEncoding is a public MasterSeed Go SDK constants.
- SeedHashMismatch — SeedHashMismatch is a public MasterSeed Go SDK constants.
- BlockHashMismatch — BlockHashMismatch is a public MasterSeed Go SDK constants.
- SourceTooShort — SourceTooShort is a public MasterSeed Go SDK constants.
- SourceTooLong — SourceTooLong is a public MasterSeed Go SDK constants.
- BlockIndexOutOfRange — BlockIndexOutOfRange is a public MasterSeed Go SDK constants.
- IntegerOverflow — IntegerOverflow is a public MasterSeed Go SDK constants.
- TargetExists — TargetExists is a public MasterSeed Go SDK constants.
- ReadFailed — ReadFailed is a public MasterSeed Go SDK constants.
- WriteFailed — WriteFailed is a public MasterSeed Go SDK constants.
- Aborted — Aborted is a public MasterSeed Go SDK constants.
- InvalidArgument — InvalidArgument is a public MasterSeed Go SDK constants.
- SeedSizeMismatch — SeedSizeMismatch is a public MasterSeed Go SDK constants.
- BlockNotInSeed — BlockNotInSeed is a public MasterSeed Go SDK constants.
- BlockSizeMismatch — BlockSizeMismatch is a public MasterSeed Go SDK constants.
- Error — Error is the structured error returned by the SDK. Context fields are optional and are populated only when relevant to the failure.
- CodeOf — CodeOf extracts a stable SDK error code through wrapped errors.
- IsCode — IsCode reports whether err or one of its causes has code.
- CreateSeedFileOptions — CreateSeedFileOptions controls atomic path publishing.
- CreateSeedFile — CreateSeedFile writes a seed beside the target, then publishes it. The default is no-overwrite; an incomplete seed is never left at seedPath.
- VerifySourceFile — VerifySourceFile verifies the seed hash before reopening the seed for the complete source pass, so untrusted seed contents are not used unchecked.
- SeedInfo — SeedInfo describes a seed file. SourceSizeKnown is false for HashSeed and InspectSeed because a seed file does not encode source length.
- VerifyInfo — VerifyInfo describes a successful complete source verification.
- BlockCountForSourceSize — BlockCountForSourceSize applies the V1 empty-file and aligned-file rules.
- SeedSizeForBlockCount — SeedSizeForBlockCount checks the block-count multiplication used by callers that work with untrusted metadata.
- SourceOffset — SourceOffset returns blockIndex*BLOCK_SIZE after checking overflow.
- SeedOffset — SeedOffset returns blockIndex*DIGEST_SIZE after checking overflow.
- CreateSeed — CreateSeed hashes source in protocol-sized blocks and writes raw 32-byte digests to sink. It never writes hexadecimal text to the sink.
- HashSeed — HashSeed computes SHA-256 over any seed bytes without validating its length.
- InspectSeed — InspectSeed computes seed_hash and requires the seed length to be a multiple of the raw digest size.
- VerifySeed — VerifySeed strictly inspects a seed and compares its raw-byte hash with the caller's expected digest using a constant-time comparison.
- VerifySource — VerifySource validates every source block against the raw digests in seed, then checks that neither stream contains extra data.
- ReadBlockHash — ReadBlockHash reads one raw digest from a random-access seed file.
- VerifyBlock — VerifyBlock hashes one caller-provided block. A short block is accepted; an API caller needs source-length context to decide whether it is the last one.
- ExpectedBlockSize — ExpectedBlockSize returns the protocol length of a block for a source of sourceSize bytes. Empty sources have no valid block indices.
- VerifySeedForSourceSize — VerifySeedForSourceSize verifies seed structure, hash, and its digest count against a caller-provided source size in a single streaming pass.
- BlockMatches — BlockMatches describes all occurrences of a digest in a trusted seed.
- FindBlockHash — FindBlockHash scans a trusted seed once and returns the first/last indices and total count of an exact 32-byte digest match.
- VerifiedBlock — VerifiedBlock identifies the first digest occurrence whose protocol block length agrees with the supplied block.
- VerifyBlockInSeed — VerifyBlockInSeed verifies membership and protocol block length in one seed pass. Seed integrity and source-size binding are checked before membership errors are returned.
- Format — V1 constants are part of the wire format and must not change within V1.
- BlockSize — V1 constants are part of the wire format and must not change within V1.
- DigestSize — V1 constants are part of the wire format and must not change within V1.
- HashAlgorithm — V1 constants are part of the wire format and must not change within V1.
- FORMAT — Upper-case aliases mirror the protocol notation used in the public spec.
- BLOCK_SIZE — V1 constants are part of the wire format and must not change within V1.
- DIGEST_SIZE — V1 constants are part of the wire format and must not change within V1.
- HASH_ALGORITHM — V1 constants are part of the wire format and must not change within V1.
- Digest — Digest is an immutable, fixed-size SHA-256 digest value.
- DigestFromBytes — DigestFromBytes constructs a Digest only from exactly 32 bytes.
- ParseDigestHex — ParseDigestHex parses exactly 64 hexadecimal characters. Whitespace and 0x prefixes are intentionally not accepted.
- DigestFromHex — DigestFromHex is an alias for ParseDigestHex.
- NewDigest — NewDigest is an alias for DigestFromBytes for callers that prefer a constructor-style name.
- Sum256 — Sum256 returns the digest of value.