-module(apiculture@default_key). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/apiculture/default_key.gleam"). -export([generate/0, prefixed/1]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC( " Default structured-secret format implementation.\n" "\n" " The v0.3.0 default is `sk__crc32_`: 16 bytes of\n" " cryptographically secure random content, Base62 encoding, an `sk` prefix,\n" " `_` separators, and four CRC32 checksum bytes. The checksum detects\n" " accidental corruption; it is not cryptographic authentication.\n" ). -file("src/apiculture/default_key.gleam", 14). ?DOC( " Generate a default format key.\n" "\n" " This produces a key in the format: `sk__crc32_`.\n" ). -spec generate() -> {ok, apiculture@key:key()} | {error, apiculture@error:error()}. generate() -> apiculture@key:new_default(). -file("src/apiculture/default_key.gleam", 24). ?DOC( " Generate a default format key with the given prefix.\n" "\n" " This produces a key in the format:\n" " `__crc32_`.\n" "\n" " The prefix should be a short semantic identifier (e.g., \"sk\", \"token\", \"key\").\n" ). -spec prefixed(binary()) -> {ok, apiculture@key:key()} | {error, apiculture@error:error()}. prefixed(Prefix) -> _pipe = apiculture@key:new_as_config(), _pipe@1 = apiculture@key:with_prefix(_pipe, Prefix), apiculture@key:generate(_pipe@1).