<PackageReference Include="System.Memory" Version="4.6.3" />

FormattingHelpers

static class FormattingHelpers
public enum HexCasing

public static int CountDecimalTrailingZeros(uint value, out uint valueWithoutTrailingZeros)

public static int CountDigits(ulong value)

public static int CountDigits(uint value)

public static int CountHexDigits(ulong value)

public static ulong DivMod(ulong numerator, ulong denominator, out ulong modulo)

We don't have access to Math.DivRem, so this is a copy of the implementation.

public static uint DivMod(uint numerator, uint denominator, out uint modulo)

We don't have access to Math.DivRem, so this is a copy of the implementation.

public static void FillWithAsciiZeros(Span<byte> buffer)

Fills a buffer with the ASCII character '0' (0x30).

public static char GetSymbolOrDefault(ref StandardFormat format, char defaultSymbol)

Returns the symbol contained within the standard format. If the standard format has not been initialized, returns the provided fallback symbol.

public static void WriteDigits(ulong value, Span<byte> buffer)

public static void WriteDigits(uint value, Span<byte> buffer)

public static void WriteDigitsWithGroupSeparator(ulong value, Span<byte> buffer)

public static void WriteFourDecimalDigits(uint value, Span<byte> buffer, int startingIndex = 0)

Writes a value [ 0000 .. 9999 ] to the buffer starting at the specified offset. This method performs best when the starting index is a constant literal.

public static void WriteHexByte(byte value, Span<byte> buffer, int startingIndex = 0, HexCasing casing = 0)

public static void WriteTwoDecimalDigits(uint value, Span<byte> buffer, int startingIndex = 0)

Writes a value [ 00 .. 99 ] to the buffer starting at the specified offset. This method performs best when the starting index is a constant literal.