
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Will generate Sequential Guids based on MongoDB's ObjectId specification. Date & time are encoded into the value so you do not need to store them separately in your database. Supports standard Guids as well as SQL Server guids.
Will generate Sequential Guids based on MongoDB's ObjectId specification sorting algorithm. Date & time are encoded into the value so you do not need to store them separately in your database
Author's Note: The entire purpose of this library is for you to have a dependency free way of generating unique uuid/Guid values that contain the time of creation which will typically result in lower clustered index fragmentation on the back end once they get persisted but it will allow you to generate the keys all the way up in WebAssembly or MAUI and pass it through your API and store it in the database this can help you with itempotency not requiring a trip to the database to generate the ID. Please DO NOT open an issue telling me it doesn't use the Unix timestamp or it isn't an ObjectId those are both true I had to find 32 additional bits to fill a Guid vs ObjectId and so I opted to use the Ticks count to do so while retaining the remainder of the Mongo algorithm. An added bonus to this is this library is not subject to break on 19 January 2038, at 03:14:07 UTC when the Unix timestamp overflows a 32 bit integer.
Returns a new Guid or SqlGuid. The 16-byte Guid or SqlGuid consists of:
If you use SQL Server then I highly recommend reading the following two articles to get a basic understanding of how SQL Server sorts uniqueidentifier values
Define an interface to the signature you like
public interface IIdGenerator
{
Guid NewId();
}
Define your implementing class which can be transient since the singleton is implemented by the framework
public class SequentialIdGenerator : IIdGenerator
{
public Guid NewId() => SequentialGuidGenerator.Instance.NewGuid();
}
Wire it up to .NET Core dependency injection in the ConfigureServices method during application startup
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IIdGenerator, SequentialIdGenerator>();
}
Finally define a base entity for your application which will contain an id and a timestamp as soon as you initialize it. Note I do not advocate setting a default Id getter this way just illustrating it can be done
public abstract class BaseEntity
{
public Guid Id { get; set; } = SequentialGuidGenerator.Instance.NewGuid();
public DateTime? Timestamp => Id.ToDateTime();
// If you really must have non-UTC time
public DateTime? LocalTime => Id.ToDateTime()?.ToLocalTime();
}
You can convert between a standard Guid and a SqlGuid using the available helper functions
var guid = SequentialGuidGenerator.Instance.NewGuid();
var sqlGuid = guid.ToSqlGuid();
OR
var sqlGuid = SequentialSqlGuidGenerator.Instance.NewSqlGuid();
var guid = sqlGuid.ToGuid();
FAQs
Will generate Sequential Guids based on MongoDB's ObjectId specification. Date & time are encoded into the value so you do not need to store them separately in your database. Supports standard Guids as well as SQL Server guids.
We found that sequentialguid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.