openactive / OpenActive.Server.NET

.NET server library, including an OpenActive Reference Implementation
MIT License
0 stars 7 forks source link

Update Reference Implementation to use a BigInt for RPDE modified to help implementers easily test for this in their implementations #219

Closed nickevansuk closed 6 months ago

nickevansuk commented 7 months ago

Simple approach to create a helper that multiplies UtcTicks so that it's big enough to require a JavaScript BigInt (but not so big that it overflows the .NET long max in the next century), and to use that helper everywhere UtcTicks is referenced (i.e. anywhere in the repo).

Note UtcTicks may already be large enough ( >2^53), so this task may be a check rather than any implementation.

Examples where UtcTicks is referenced:

civsiv commented 7 months ago

UtcTicks is big enough as it is. Currently value is 638445888000000000 which is greater than 2^53 and therefore has to be a long in C# implementations and a BigInt in JS implementations.