Skip to content

[@thi.ng/ksuid] KSUID32 overflows during 2088 #403

Closed
@aelr

Description

@aelr

This code using KSUID32 fails:

idgen.fromEpoch(new Date("2089-01-01").getTime())

It throws at https://github.com/aelr/umbrella/blob/develop/packages/ksuid/src/aksuid.ts#L77:

assert(t >= 0, "configured base epoch must be in the past");

For this specific case, t = -2139591296

Also, should the error message be, "configured base epoch must not be in the past"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions