Re: [w3c/IndexedDB] Track ES BigInt work (#230)

It's a disaster that we cannot use BigInt's as keys, however, we can use a left-padded string instead.

This should maintain numerical ordering when using `IDBKeyRange` etc.

```
const NUM_DIGITS = 20; // increase if larger numbers are possible
const key_str = `${key_bigint}`.padStart(NUM_DIGITS, "0");
```

I'm not sure what the performance implications are with using strings here, but it's better than the alternative of not being able to use IndexedDB at all.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/230#issuecomment-1501167836
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/IndexedDB/issues/230/1501167836@github.com>

Received on Sunday, 9 April 2023 16:45:31 UTC