ulid icon indicating copy to clipboard operation
ulid copied to clipboard

Use ParseStrict to be invalided ILOU characters #69

Open u5surf opened this issue 1 year ago • 0 comments

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

u5surf avatar Apr 07 '24 14:04 u5surf