Skip to content

Conversation

@u5surf
Copy link

@u5surf u5surf commented Apr 7, 2024

Fix #69

The rust ulid crate has no #69 ‘s issue below, that is why our golang's library should same condition for command to use ulid.ParseStrict by default.

crates: https://docs.rs/ulid/latest/ulid/
test code:

% cat ./src/main.rs 
use ulid::Ulid;

fn main() {
    let result1 = Ulid::from_string("0LLLLLLLLLLLLLLLLLLLLLLLLL");
    let result2 = Ulid::from_string("01111111111111111111111111");
    assert_eq!(result1, result2);
}

result

% ./target/debug/ulid-test
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Err(InvalidChar)`,
 right: `Ok(Ulid(1372106318229590578481349223515194401))`', src/main.rs:6:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ULIDs contains ILOU will be parsed as weird timestamps

1 participant