Skip to content

Conversation

@cbuctok
Copy link
Owner

@cbuctok cbuctok commented Nov 7, 2025

#2

Major changes:
- Updated prefix validation to allow underscores within prefixes
  - Prefixes can now contain underscores in the middle
  - Prefixes must still start and end with lowercase letters
  - Follows regex: ^([a-z]([a-z_]{0,61}[a-z])?)?$
- Improved suffix validation to properly reject invalid base32 characters (i, l, o, u)
- Updated spec test files (valid.yml and invalid.yml) to version 0.3.0
  - Added valid test case: pre_fix_00000000000000000000000000
  - Added invalid test cases: _prefix_... and prefix__...
- Updated README.md to reference version 0.3.0

Breaking changes from 0.2.0:
- Prefixes with underscores (e.g., "pre_fix") are now VALID
- Prefixes starting or ending with underscores are now explicitly INVALID
The Parse method was using IndexOf to find the first underscore, which
fails when prefixes contain underscores (allowed in 0.3.0 spec).

Changed logic to:
- Extract the last 26 characters as the suffix
- Check that the character before the suffix is the separator underscore
- Everything before that separator is the prefix

This correctly parses 'pre_fix_00000000000000000000000000' as:
  prefix: 'pre_fix'
  suffix: '00000000000000000000000000'

Fixes test failure: pre_fix_00000000000000000000000000 should be valid
@cbuctok cbuctok merged commit 8dd1ac8 into main Nov 7, 2025
10 checks passed
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.

3 participants