Some schema libraries support two way conversion of data, often referred to as "encoding" and "decoding".
We benchmark the time taken to encode and decode a bigint to and from a string.
Copy to clipboardimport * as z from "zod"; const bigIntFromString = z.codec(z.string(), z.bigint(), { decode: (str) => BigInt(str), encode: (bigint) => bigint.toString(), }); bigIntFromString.encode(1234567890123456789n); // "1234567890123456789" bigIntFromString.decode("1234567890123456789"); // 1234567890123456789n
Invalid data
We don't benchmark codecs with invalid data, as many libraries require the input to be correctly typed before passing it to the codec.
Optimizations
No results found
Try a different combination of filters