(x: number | bigint)
| 13 | } |
| 14 | |
| 15 | function calcHeaderSize(x: number | bigint): number { |
| 16 | if (x < 24) return 1; |
| 17 | if (x < 2 ** 8) return 2; |
| 18 | if (x < 2 ** 16) return 3; |
| 19 | if (x < 2 ** 32) return 5; |
| 20 | return 9; |
| 21 | } |
| 22 | |
| 23 | export function calcEncodingSize(x: CborType): number { |
| 24 | if (x == undefined || typeof x === "boolean") return 1; |
no outgoing calls
no test coverage detected