Eigenverft.NetLib.Infrastructure
  • Guides
  • API
Show / Hide Table of Contents
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.ConfigurationSets
    • ConfigurationSetApplyMode
    • ConfigurationSetBuilderBindingExtensions
    • ConfigurationSetCoordinatorExtensions
    • ConfigurationSetDefinition
    • ConfigurationSetEventArgs
    • ConfigurationSetEventKind
    • ConfigurationSetNotification
    • ConfigurationSetParticipantSwitchResult
    • ConfigurationSetPendingRestartChange
    • ConfigurationSetRegistration
    • ConfigurationSetStateApplyResult
    • ConfigurationSetStateApplyStatus
    • ConfigurationSetStateFailureKind
    • ConfigurationSetStateStatus
    • ConfigurationSetStateStoreEventArgs
    • ConfigurationSetStateStoreEventKind
    • ConfigurationSetStateStoreExtensions
    • ConfigurationSetStateStoreStatus
    • ConfigurationSetStatus
    • ConfigurationSetSwitchFailureKind
    • ConfigurationSetSwitchResult
    • ConfigurationSetSwitchStatus
    • ConfigurationSetSwitchableJsonExtensions
    • IConfigurationSetCoordinator
    • IConfigurationSetDesiredStateStore
    • IConfigurationSetEventHub
    • IConfigurationSetManager
    • IConfigurationSetStateStore
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Diagnostics
    • ConfigurationPrecedenceDiagnosticsExtensions
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Sources
    • HostApplicationBuilderConfigurationExtensions
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.SwitchableJson
    • IJsonConfigurationSourcePreparation
    • ISwitchableJsonConfiguration
    • JsonConfigurationCandidatePreparation
    • JsonConfigurationCandidatePreparations
    • JsonConfigurationSourcePreparationContext
    • JsonConfigurationSourcePreparationException
    • JsonConfigurationValueProtection
    • SwitchableJsonConfigurationEventArgs
    • SwitchableJsonConfigurationEventKind
    • SwitchableJsonConfigurationExtensions
    • SwitchableJsonFailureKind
    • SwitchableJsonPreparationStatus
    • SwitchableJsonRegistrationOptions
    • SwitchableJsonRuntimeFailurePolicy
    • SwitchableJsonSwitchPreparation
    • SwitchableJsonSwitchResult
    • SwitchableJsonSwitchStatus
  • Eigenverft.NetLib.Infrastructure.Hosting.Configuration.Values
    • ConfigurationValueCodec
    • ConfigurationValueCodecs
    • ConfigurationValueKind
    • JsonConfigurationFileEncoder
  • Eigenverft.NetLib.Infrastructure.Hosting.DirectoryLayout
    • AppDirectoryLayout
    • AppDirectoryLayoutFactory
    • DefaultDirectory
    • DefaultDirectoryExtensions
    • DefaultDirectoryNameAttribute
    • HostApplicationBuilderDirectoryLayoutExtensions
    • HostApplicationBuilderFactory
    • IAppDirectoryLayout
  • Eigenverft.NetLib.Infrastructure.Hosting.Logging.BootstrapLogger
    • BootstrapLogger
    • BootstrapLogger<TCategoryName>
  • Eigenverft.NetLib.Infrastructure.Security.Certificates
    • CertificateKeyProfile
    • CertificatePurpose
    • CertificateRecoveryMode
    • CertificateSubject
    • ManagedCertificateAction
    • ManagedCertificateFile
    • ManagedCertificateFileOptions
    • ManagedCertificateResult
    • SelfSignedCertificateFactory
    • SelfSignedCertificateOptions
  • Eigenverft.NetLib.Infrastructure.Security.MachineBinding
    • PhysicalMachineBinding
  • Eigenverft.NetLib.Infrastructure.Text
    • Base92JsonSafeEncoder
  • Eigenverft.NetLib.Infrastructure.Transformations
    • ReversibleStringTransform
    • ReversibleStringTransform.TryReverseDelegate
    • ReversibleStringTransforms

Class Base92JsonSafeEncoder

Encodes arbitrary bytes with a canonical base-92 representation that can appear inside a JSON string without JSON string escaping.

Inheritance
object
Base92JsonSafeEncoder
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Eigenverft.NetLib.Infrastructure.Text
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public static class Base92JsonSafeEncoder
Remarks

The alphabet contains every printable ASCII character from U+0021 through U+007E except double quote (") and backslash (</code>). Space is excluded by starting at U+0021. The resulting 92 symbols are: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~.

Encoding interprets the non-leading-zero input bytes as one unsigned big-endian base-256 integer and converts it to base 92. Each leading zero byte is represented by one leading !, the zero-valued alphabet symbol. Empty input encodes as an empty string and no padding is used.

This type provides representation only. Base92JsonSafe does not provide cryptographic protection and should not be treated as encryption. JSON-safe here means JSON-string-safe; characters such as <, >, &, apostrophe, and slash remain part of the alphabet and may require separate handling in other contexts.

Fields

| Edit this page View Source

Alphabet

Gets the canonical 92-character alphabet in digit order from zero through 91.

Declaration
public const string Alphabet = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"
Field Value
Type Description
string

Methods

| Edit this page View Source

Decode(string)

Decodes one canonical Base92JsonSafe string.

Declaration
public static byte[] Decode(string value)
Parameters
Type Name Description
string value

The encoded value.

Returns
Type Description
byte[]

The decoded bytes.

Exceptions
Type Condition
ArgumentNullException

value is null.

FormatException

value contains a character outside the alphabet.

| Edit this page View Source

Encode(byte[])

Encodes bytes using the canonical Base92JsonSafe representation.

Declaration
public static string Encode(byte[] bytes)
Parameters
Type Name Description
byte[] bytes

The bytes to encode.

Returns
Type Description
string

The Base92JsonSafe string.

| Edit this page View Source

TryDecode(string?, out byte[])

Attempts to decode one canonical Base92JsonSafe string.

Declaration
public static bool TryDecode(string? value, out byte[] bytes)
Parameters
Type Name Description
string value

The encoded value.

byte[] bytes

Receives the decoded bytes on success.

Returns
Type Description
bool

true when decoding succeeds; otherwise false.

  • Edit this page
  • View Source
In this article
Back to top