Tedd.BitUtils 1.0.1

Bit manipulation of Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64: Ror, Rol, SetBit, IsBitSet

There is a newer version of this package available.
See the version list below for details.
Install-Package Tedd.BitUtils -Version 1.0.1
dotnet add package Tedd.BitUtils --version 1.0.1
<PackageReference Include="Tedd.BitUtils" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tedd.BitUtils --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tedd.BitUtils, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Tedd.BitUtils as a Cake Addin
#addin nuget:?package=Tedd.BitUtils&version=1.0.1

// Install Tedd.BitUtils as a Cake Tool
#tool nuget:?package=Tedd.BitUtils&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Tedd.BitUtils

Bit manipulation extension methods for Byte, short (Int16), ushort (UInt16), int (Int32), uint (UInt32), long (Int64) and ulong (UInt64).

Types can be manipulated in-place or by returning a modified copy. All methods are tagged for inline compile. Ror and Rol methods should be optimized by RyuJit to use CPU implementations.

Faster versions of Ror() and Rol() are hardcoded to shift 1.
Faster versions of SetBit0(n) and SetBit1(n) skips the branch required for SetBit(n, true/false).

Note that CPU most likely only supports bit manipulation on Int32 and Int64, so Byte and Int16 will be treated as Int32 internally. Result will be correct, but there is no speed benefit and possibly a small penalty for using smaller types than Int32.

Ror and Rol is only implemented for 32-bit and 64-bit integers.

Tedd.BitUtils

Bit manipulation extension methods for Byte, short (Int16), ushort (UInt16), int (Int32), uint (UInt32), long (Int64) and ulong (UInt64).

Types can be manipulated in-place or by returning a modified copy. All methods are tagged for inline compile. Ror and Rol methods should be optimized by RyuJit to use CPU implementations.

Faster versions of Ror() and Rol() are hardcoded to shift 1.
Faster versions of SetBit0(n) and SetBit1(n) skips the branch required for SetBit(n, true/false).

Note that CPU most likely only supports bit manipulation on Int32 and Int64, so Byte and Int16 will be treated as Int32 internally. Result will be correct, but there is no speed benefit and possibly a small penalty for using smaller types than Int32.

Ror and Rol is only implemented for 32-bit and 64-bit integers.

  • .NETCoreApp 2.0

    • No dependencies.
  • .NETCoreApp 2.1

    • No dependencies.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.6 212 3/20/2020
1.0.5 222 12/15/2019
1.0.4 201 12/15/2019
1.0.3 176 12/8/2019
1.0.2 185 12/7/2019
1.0.1 180 11/8/2019
1.0.0 194 11/7/2019
Show less