AyCode.Core/AyCode.Core/Helpers
Loretta 17daf0fef2 Document AcBinary wire format, sync docs, update conventions
- Add BINARY_FORMAT.md: full AcBinary wire format spec (markers, encoding, options, protocol, interactions)
- Reference BINARY_FORMAT.md from GLOSSARY.md, Binaries/README.md, and Serializers/Binaries/README.md; add new glossary terms
- Clarify and expand config options tables to match new doc
- Add/clarify LLM maintenance rules: always sync .md files with code, auto-fix discrepancies
- Update root README.md: AyCode.Core targets .NET 9, not 10; stress doc/code sync
- Add code reuse and doc sync conventions to copilot-instructions.md and CONVENTIONS.md
- Add docs/ folder and BINARY_FORMAT.md to solution as Solution Items
- Minor clarifications and cross-links in ARCHITECTURE.md and other docs
2026-03-29 09:11:57 +02:00
..
AcCharsGenerator.cs AcCharsGenerator.NewPassword improvements 2024-07-06 07:22:26 +02:00
AcObservableCollection.cs Refactor serialization infra, add perf benchmarks 2025-12-30 19:29:39 +01:00
ConstHelper.cs .net packages update to 8.0.8; fixes, etc... 2024-08-14 16:05:32 +02:00
JsonUtilities.cs Optimize serialization: precompute type metadata, remove caches 2026-02-08 08:13:34 +01:00
PasswordHasher.cs refactoring, improvements, fixes... 2024-05-03 15:37:41 +02:00
PropertyHelper.cs Refactor: Add high-perf JSON serializer & merge support 2025-12-14 19:34:49 +01:00
README.md Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
TaskHelper.cs Refactor JSON/SignalR infra; add full test & benchmark suite 2025-12-11 21:25:50 +01:00

README.md

Helpers

Utility classes for token generation, observable collections, type metadata, password security, and async patterns.

Key Files

  • AcCharsGenerator.cs — Random token/password generation from predefined char pools (Letters, Numbers, LettersAndNumbers). NewToken() (8-12 chars), NewPassword() (configurable length).
  • AcObservableCollection.cs — Thread-safe ObservableCollection<T> with batch updates (BeginUpdate()/EndUpdate()), SynchronizationContext capture for UI thread marshalling (Blazor), PopulateFromJson(), SortAndReplace().
  • ConstHelper.cs — Reflection-cached lookup of const int field names by value. Used for debug/logging to show human-readable constant names.
  • JsonUtilities.cs — Central type metadata and detection utilities:
    • Pre-cached Type handles for primitives, generics, collections
    • FrozenSet<Type> for fast primitive checks
    • IsPrimitiveOrStringFast(), IsGenericCollectionType(), IsDictionaryType(), GetCollectionElementType()
    • DetectSerializerType() — auto-detect JSON vs Binary from bytes/string
    • UTF8 buffer pool: RentUtf8Buffer(), ReturnUtf8Buffer()
    • String escaping: NeedsEscaping(), WriteEscapedString()
  • PasswordHasher.cs — PBKDF2-HMAC-SHA512 with 10,000 iterations. Critical: do not modify GenerateDynamicSalt() or GenerateFinallySalt() — login will break. Format: $bcrypt$v=1$salt=...base64...$hash=...base64...
  • PropertyHelper.csCopyPublicValueTypeProperties<TSource, TDest>() for DTO/entity mapping via reflection.
  • TaskHelper.csWaitTo()/WaitToAsync() (poll predicate with timeout using PeriodicTimer), Forget() (fire-and-forget), RunOnThreadPool().