- Mishandling of
UnsafeMutableBufferPointer
inScru128Id#description
- Refactored private methods and error messages
- Improved documentation about generator's clock rollback behavior
- Updated README
Most notably, v3 switches the letter case of generated IDs from uppercase (e.g., "036Z951MHJIKZIK2GSL81GR7L") to lowercase (e.g., "036z951mhjikzik2gsl81gr7l"), though it is technically not supposed to break existing code because SCRU128 is a case-insensitive scheme. Other changes include the removal of deprecated APIs.
- Deprecated items:
Scru128Generator#generateCore()
Scru128Generator#lastStatus
andScru128Generator.Status
- Letter case of generated IDs from uppercase to lowercase
- Return type of
Scru128Id#bytes
property from[UInt8]
to tuple of 16UInt8
byte values, as a result of change in internal representation ofScru128Id
Scru128Generator
toScru128Generator<R: RandomNumberGenerator>
to substitute static generics for dynamic existential type- Edge case behavior of generator functions' rollback allowance handling
Scru128Id#byteArray
to emulate oldScru128Id#bytes
property
Scru128Id#byteArray
as synonym for deprecatedbytes
Scru128Id
initializer that receives tuple of 16 byte values
Scru128Id#bytes
to help migration to v3
- Test case that could not compile with Xcode 13.4
- Improved test cases
- multi-threaded test cases by adding proper @available attribute
Sendable
protocol conformance toScru128Id
- Upgraded minimum Swift version to 5.6
- Rewrote multi-threaded test cases using Swift Concurrency
- Fixed README
- Tweaked docs and tests
generateOrAbort()
andgenerateOrAbortCore()
toScru128Generator
(formerly named asgenerateNoRewind()
andgenerateCoreNoRewind()
)Scru128Generator#generateOrResetCore()
Scru128Generator#generateCore()
Scru128Generator#lastStatus
andScru128Generator.Status
generateNoRewind()
andgenerateCoreNoRewind(timestamp:rollbackAllowance:)
toScru128Generator
(experimental)
- Improved documentation about generator method flavors
Decodable
implementation ofScru128Id
to throw error on failure instead of raising runtime panic
Decodable
behavior so it tries to parse byte array as well as string
- Sequence and IteratorProtocol implementations to
Scru128Generator
to make it work as infinite iterator
generateCore()
to updatecounter_hi
whentimestamp
passed < 1000
generateCore()
to reject zero astimestamp
value
generateCore()
andlastStatus
toScru128Generator
- Textual representation: 26-digit Base32 -> 25-digit Base36
- Field structure: {
timestamp
: 44 bits,counter
: 28 bits,per_sec_random
: 24 bits,per_gen_random
: 32 bits } -> {timestamp
: 48 bits,counter_hi
: 24 bits,counter_lo
: 24 bits,entropy
: 32 bits } - Timestamp epoch: 2020-01-01 00:00:00.000 UTC -> 1970-01-01 00:00:00.000 UTC
- Counter overflow handling: stall generator -> increment timestamp
setScru128Logger()
as counter overflow is no longer likely to occurScru128Id#counter
,Scru128Id#perSecRandom
,Scru128Id#perGenRandom
Scru128Id#counterHi
,Scru128Id#counterLo
,Scru128Id#entropy
- Initial stable release