| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Compile time string encryption with NativeAOT
This example utilises the fact that the static constructors including static readonly fields are pre-interpreted at compile time when the ILC(NativeAOT compiler) translates the code into native code.
As the strings are a reference-type that are allocated on the heap, they are ultimately baked statically into the compiled executable. Therefore, only stack allocated Span<char> can be encrypted. Any solution is welcomed via PR, however I have yet to find a viable solution as the issue tightly relates to how strings work in .NET.
| Back | FazBrowse Home | New Git URL |