Mix.install([
{:req, "~> 0.5.8"}
])
A simple .NET Core 8 sample running on Linux to show AES GCM encryption...
using System.Security.Cryptography;
using System.Text;
// https://learn.microsoft.com/en-us/dotnet/standard/security/cross-platform-cryptography#authenticated-encryption
Console.Out.WriteLine($"Is supported: {AesGcm.IsSupported}");
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net8.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.Identity.Client" Version="4.64.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsafe static byte[] DoublesToBytes(double[] value) | |
{ | |
var bytes = new byte[8*value.Length]; | |
fixed (byte* b = bytes) | |
{ | |
for (int i = 0; i < value.Length; i++) | |
{ | |
var v = value[i]; | |
*((int*)(b + 8*i)) = *(int*)&v; | |
*((int*)(b + 8*i+4)) = *(((int*)&v) + 1); |
NewerOlder