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"
296296// Basic ASCII string - returns BigIntCoercion instance
297297const hello = stringToBigInt (" hello" )
298298hello .toBigInt () // 448378203247n
299- hello .toInt32 () // 1818522991
299+ hello .toInt32 () // 1701604463
300300hello .toUint8 () // 111 (lower 8 bits)
301301
302302// Single character
@@ -312,8 +312,8 @@ stringToBigInt("🚀").toBigInt() // 4036991616n
312312stringToBigInt (" 🚀" ).toInt32 () // -257975680
313313
314314// Chinese characters
315- stringToBigInt (" 你好" ).toBigInt () // 15060223084n
316- stringToBigInt (" 你好" ).toChar () // '好 ' (lower 16 bits)
315+ stringToBigInt (" 你好" ).toBigInt () // 251503099356605n
316+ stringToBigInt (" 你好" ).toChar () // 'ꖽ ' (lower 16 bits)
317317
318318// Mixed content
319319const mixed = stringToBigInt (" Hello 🌍" )
Original file line number Diff line number Diff line change 1010 * const bn = new BigIntCoercion(123456789n);
1111 * bn.toInt32(); // 123456789
1212 * 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)
1414 *
1515 * @example
1616 * // Collision example - large values wrap around
@@ -242,7 +242,7 @@ export class BigIntCoercion {
242242 * @example
243243 * new BigIntCoercion(65n).toChar(); // 'A'
244244 * 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 )
246246 */
247247 toChar ( ) : string {
248248 const codePoint = this . toUint16 ( )
You can’t perform that action at this time.
0 commit comments