The return type of the Decode method has changed from int[] to IReadOnlyList<int> (to eliminate unnecessary memory allocation); so the code snippets on the .NET page of the site need to be updated to:
var sqids = new SqidsEncoder<int>();
var id = sqids.Encode(1, 2, 3); // "86Rf07"
var numbers = sqids.Decode(id); // [1, 2, 3]
var sqids = new SqidsEncoder<int>(new()
{
Alphabet = "FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE"
});
var id = sqids.Encode(1, 2, 3); // "B4aajs"
var numbers = sqids.Decode(id); // [1, 2, 3]
var sqids = new SqidsEncoder<int>(new()
{
MinLength = 10
});
var id = sqids.Encode(1, 2, 3); // "86Rf07xd4z"
var numbers = sqids.Decode(id); // [1, 2, 3]
This is probably the last time 😅
The return type of the
Decode
method has changed fromint[]
toIReadOnlyList<int>
(to eliminate unnecessary memory allocation); so the code snippets on the .NET page of the site need to be updated to: