### Install Ipfs.Core via dotnet CLI Source: https://github.com/richardschneider/net-ipfs-core/blob/master/README.md Installs the Ipfs.Core NuGet package using the .NET CLI. This command-line approach is common for .NET Core and .NET 5+ projects. ```bash > dotnet add package Ipfs.Core ``` -------------------------------- ### List NuGet Packages (Prerelease) Source: https://github.com/richardschneider/net-ipfs-core/wiki/Continuous-Integration This command lists all prerelease versions of IPFS.Core packages from a specified AppVeyor NuGet feed. It requires the NuGet CLI to be installed. ```powershell nuget list -source https://ci.appveyor.com/nuget/net-ipfs-core-wursx0qon9ff -prerelease -allversions ``` -------------------------------- ### Verify .NET Core SDK Version Source: https://github.com/richardschneider/net-ipfs-core/wiki/.net-standard This snippet shows how to verify the installed .NET Core SDK version using the `dotnet --info` command. It displays information about the .NET Command Line Tools, runtime environment, and the .NET Core Shared Framework Host. ```Bash >dotnet --info .NET Command Line Tools (2.0.0) Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9 Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.0\ Microsoft .NET Core Shared Framework Host Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d ``` -------------------------------- ### Install Ipfs.Core via Package Manager Console Source: https://github.com/richardschneider/net-ipfs-core/blob/master/README.md Installs the Ipfs.Core NuGet package using the Package Manager Console in Visual Studio. This is the standard way to add the library to your .NET project. ```powershell PM> Install-Package Ipfs.Core ``` -------------------------------- ### Get and Use Hashing Algorithm in C# Source: https://github.com/richardschneider/net-ipfs-core/blob/master/doc/articles/multihash.md Demonstrates how to retrieve a specific hashing algorithm implementation (e.g., 'sha3-256') and use it to compute a hash for a given byte array. It includes assertions to verify the correctness of the computed hash. ```csharp public void GetHasher() { using (var hasher = HashingAlgorithm.GetAlgorithm("sha3-256")) { Assert.IsNotNull(hasher); var input = new byte[] { 0xe9 }; var expected = "f0d04dd1e6cfc29a4460d521796852f25d9ef8d28b44ee91ff5b759d72c1e6d6".ToHexBuffer(); var actual = hasher.ComputeHash(input); CollectionAssert.AreEqual(expected, actual); } } ``` -------------------------------- ### Create and Push Git Tag for Release Source: https://github.com/richardschneider/net-ipfs-core/wiki/Continuous-Integration This command creates an annotated Git tag for a new release and pushes it to the origin repository. This is a common method for initiating a release process. ```bash git tag -a v2.1.0 -m "Release v2.1.0" git push --tags origin ``` -------------------------------- ### Generate Changelog with clgt Source: https://github.com/richardschneider/net-ipfs-core/wiki/Creating-release-notes This command uses the 'clgt' tool to generate a CHANGELOG.md file. It takes a version range and a GitHub commit URL as input. The output is a markdown file containing the release notes. ```bash clgt -t .. -u https://github.com/richardschneider/net-ipfs-core/commit ``` -------------------------------- ### NuGet Package Dependencies Source: https://github.com/richardschneider/net-ipfs-core/wiki/.net-standard This XML snippet lists the NuGet packages required for the project, including their versions and target framework. It highlights packages that do not target .NET Standard but are expected to work. ```XML ``` -------------------------------- ### Create Merkle DAG Node with Links in C# Source: https://github.com/richardschneider/net-ipfs-core/blob/master/doc/articles/dag.md This C# code snippet demonstrates how to create a Merkle DAG node with two links. It shows the process of converting byte arrays to DagNodes, creating DagLinks from them, and then assembling a parent DagNode containing these links. Assertions are included to verify the number of links and the node's ID. ```csharp var a = Encoding.UTF8.GetBytes("a"); var anode = new DagNode(a); var alink = anode.ToLink("a"); var b = Encoding.UTF8.GetBytes("b"); var bnode = new DagNode(b); var blink = bnode.ToLink("b"); var node = new DagNode(null, new[] { alink, blink }); Assert.AreEqual(2, node.Links.Count()); Assert.AreEqual("QmbNgNPPykP4YTuAeSa3DsnBJWLVxccrqLUZDPNQfizGKs", (string)node.Id); ``` -------------------------------- ### Disable AssemblyInfo Generation Source: https://github.com/richardschneider/net-ipfs-core/wiki/.net-standard This XML configuration snippet demonstrates how to disable the automatic generation of assembly information in .NET projects. This is useful when managing assembly attributes directly within the .csproj file. ```XML false ``` -------------------------------- ### Compute MultiHash in C# Source: https://github.com/richardschneider/net-ipfs-core/blob/master/doc/articles/multihash.md Computes a MultiHash for a given byte array using a specified hashing algorithm. This is a fundamental operation for data identification in IPFS. ```csharp var hello = Encoding.UTF8.GetBytes("Hello world"); var mh = MultiHash.ComputeHash(hello, "sha2-256"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.