File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ import { stringToBigInt } from "k-number-utils"
296
296
// Basic ASCII string - returns BigIntCoercion instance
297
297
const hello = stringToBigInt (" hello" )
298
298
hello .toBigInt () // 448378203247n
299
- hello .toInt32 () // 1818522991
299
+ hello .toInt32 () // 1701604463
300
300
hello .toUint8 () // 111 (lower 8 bits)
301
301
302
302
// Single character
@@ -312,8 +312,8 @@ stringToBigInt("🚀").toBigInt() // 4036991616n
312
312
stringToBigInt (" 🚀" ).toInt32 () // -257975680
313
313
314
314
// Chinese characters
315
- stringToBigInt (" 你好" ).toBigInt () // 15060223084n
316
- stringToBigInt (" 你好" ).toChar () // '好 ' (lower 16 bits)
315
+ stringToBigInt (" 你好" ).toBigInt () // 251503099356605n
316
+ stringToBigInt (" 你好" ).toChar () // 'ꖽ ' (lower 16 bits)
317
317
318
318
// Mixed content
319
319
const mixed = stringToBigInt (" Hello 🌍" )
Original file line number Diff line number Diff line change 10
10
* const bn = new BigIntCoercion(123456789n);
11
11
* bn.toInt32(); // 123456789
12
12
* bn.toUint8(); // 21 (truncated to 8 bits)
13
- * bn.toChar(); // 'Í ' (Unicode character from lower 16 bits)
13
+ * bn.toChar(); // '촕 ' (Unicode character from lower 16 bits)
14
14
*
15
15
* @example
16
16
* // Collision example - large values wrap around
@@ -242,7 +242,7 @@ export class BigIntCoercion {
242
242
* @example
243
243
* new BigIntCoercion(65n).toChar(); // 'A'
244
244
* new BigIntCoercion(8364n).toChar(); // '€' (Euro sign)
245
- * new BigIntCoercion(128512n).toChar(); // '😀 ' (would wrap to 16 bits)
245
+ * new BigIntCoercion(128512n).toChar(); // '' (wraps to 16 bits: 62976 )
246
246
*/
247
247
toChar ( ) : string {
248
248
const codePoint = this . toUint16 ( )
You can’t perform that action at this time.
0 commit comments