8000 KSUIDs do not sort properly. · Issue #77 · segmentio/ksuid · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
KSUIDs do not sort properly. #77
Open
@ShawnMilo

Description

@ShawnMilo

On the Linux command line and in PostgreSQL, ksuids do not sort properly.

  1. 2SmasRGkif9qETAHwssB4GGYwdi can be converted to the timestamp 2023-07-19 04:13:36 -0400 EDT
  2. 2STcKMQ7MGgoDxpX9A5WuaJlx8V can be converted to the timestamp 2023-07-12 10:59:06 -0400 EDT

However, PostgreSQL and the Linux sort command both sort 2SmasRGkif9qETAHwssB4GGYwdi lower than 2STcKMQ7MGgoDxpX9A5WuaJlx8V, because evidently, all lower-case letters sort before capital letters.

I'm assuming that the ksuid algorithm uses the logic that capital letters have a lower ASCII value:

Python 3.11.2 (mai
50AD
n, May 30 2023, 17:45:26) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ord('A')
65
>>> ord('a')
97
>>> 

I love the project and use ksuids as much as possible, but this issue has bitten me at work and been the cause of some subtle bugs.
Is it impossible to fix in a backwards-compatible way?

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

      0