src/Orleans.Core.Abstractions/IDs/GrainIdKeyExtensions.cs
/// <summary>
/// Creates an <see cref="IdSpan"/> representing a <see cref="long"/> key.
/// </summary>
/// <param name="key">
/// The key.
/// </param>
/// <returns>
/// An <see cref="IdSpan"/> representing the provided key.
/// </returns>
Creates an  representing a  key.
Creates an representing a key .
public static IdSpan CreateIntegerKey(long key)
        {
            Span<byte> buf = stackalloc byte[sizeof(long) * 2];
            Utf8Formatter.TryFormat(key, buf, out var len, 'X');
            Debug.Assert(len > 0, "Unable to format the provided value as a UTF8 string");
            return new IdSpan(buf.Slice(0, len).ToArray());
        }
public static IdSpan CreateIntegerKey ( long key ) { Span < byte > buf = stackalloc byte [ sizeof ( long ) * 2 ] ; Utf8Formatter . TryFormat ( key , buf , out var len , ' ' ) ; Debug . Assert ( len > 0 , " " ) ; return new IdSpan ( buf . Slice ( 0 , len ) . ToArray ( ) ) ; }
Creates an  representing a  key.
Creates an representing a key .
An  representing the provided key.
An representing the provided key .
key
long
None