All properties computed from a snowflake are now computed properties and no longer stored in the struct
Renamed Snowflake's value to rawValue for RawRepresentable conformance and to match other Swift APIs
Added ExpressibleByIntegerLiteral conformance to Snowflake for easier direct input of snowflakes (useful when testing)
Made masking numbers look less magical by putting them in hex
Changed masking numbers for processID (61440 = 0xF000 → 0x1F000) and workerID (983040 = 0xF0000 → 0x3E0000) because I think those are what were actually intended
Since snowflake computed properties are no longer stored, switched them from UInt8s and UInt16s to Ints to make them easier to work with
Moved Discord epoch to a static constant so we don't randomly see 1420070400 flying around Use it with Date(timeInterval: timestamp, since: Snowflake.epoch) or date.timeIntervalSince(Snowflake.epoch)
Added fakeSnowflake class method to easily generate fake snowflakes from dates
Changes:
value
torawValue
for RawRepresentable conformance and to match other Swift APIsDate(timeInterval: timestamp, since: Snowflake.epoch)
ordate.timeIntervalSince(Snowflake.epoch)