(x: bigint)
| 4 | import type { CborType } from "./types.ts"; |
| 5 | |
| 6 | function calcBytes(x: bigint): number { |
| 7 | let bytes = 0; |
| 8 | while (x > 0n) { |
| 9 | ++bytes; |
| 10 | x >>= 8n; |
| 11 | } |
| 12 | return bytes; |
| 13 | } |
| 14 | |
| 15 | function calcHeaderSize(x: number | bigint): number { |
| 16 | if (x < 24) return 1; |
no outgoing calls
no test coverage detected