(str: string)
| 177 | |
| 178 | // based on https://www.danvk.org/hex2dec.html (JS can not handle more than 56b) |
| 179 | function byteStringToDecString(str: string): string { |
| 180 | let decimal = ''; |
| 181 | let toThePower = '1'; |
| 182 | |
| 183 | for (let i = str.length - 1; i >= 0; i--) { |
| 184 | decimal = addBigInt(decimal, numberTimesBigInt(byteAt(str, i), toThePower)); |
| 185 | toThePower = numberTimesBigInt(256, toThePower); |
| 186 | } |
| 187 | |
| 188 | return decimal.split('').reverse().join(''); |
| 189 | } |
| 190 | |
| 191 | // x and y decimal, lowest significant digit first |
| 192 | function addBigInt(x: string, y: string): string { |
nothing calls this directly
no test coverage detected
searching dependent graphs…