Skip to content

Releases: iwater/react-native-nitro-buffer

v0.0.15

11 Feb 08:24

Choose a tag to compare

Add Android linker compatibility and fix type casting in byteLength/write methods

  • Update android/CMakeLists.txt to force both sysv and gnu hash styles for
    Android loader compatibility
  • Fix return value type casting in HybridNitroBuffer.cpp:
    • Explicitly cast integer results to double in byteLength() method for
      hex, base64, binary, and latin1 encodings
    • Add new 'binary'/'latin1' encoding support in byteLength() with UTF-8
      code point counting
    • Ensure write() method returns double for all encodings (utf8, hex,
      base64, binary/latin1)
    • Implement UTF-8 decoding for binary/latin1 encoding in write() method
  • Bump package version from 0.0.14 to 0.0.15

v0.0.14: chore: bump version to 0.0.14 and switch to ES modules

31 Dec 07:54

Choose a tag to compare

chore: bump version to 0.0.14 and switch to ES modules

  • Bump package version from 0.0.12 to 0.0.14
  • Add ES module support (type: module)
  • Update TypeScript config for modern module setup
  • Clean up .gitignore entries

0.0.11

25 Dec 06:49

Choose a tag to compare

add files for android platform

v0.0.4: Optimize UTF-8 `toString` performance with two-pass validation strategy

18 Dec 05:07

Choose a tag to compare

Optimize UTF-8 toString performance with two-pass validation strategy

Changes Made:

  • Fixed a 90% performance regression in toString("utf8") by implementing two-pass UTF-8 validation in HybridNitroBuffer.cpp
  • Added fast-path for pure ASCII/valid UTF-8 using memcpy, falling back to slow path only for invalid sequences
  • Updated benchmark data in README files to reflect latest performance

v0.0.3: Fix Buffer.toString to match Node.js UTF-8 decoding behavior

17 Dec 18:42

Choose a tag to compare

Fix Buffer.toString to match Node.js UTF-8 decoding behavior

Summary

Updated Buffer.toString to handle invalid UTF-8 sequences correctly by replacing malformed bytes with U+FFFD (�) replacement characters, matching Node.js behavior per WHATWG standards.

Changes

  1. C++ Implementation (HybridNitroBuffer.cpp):

    • Fixed UTF-8 decoding to replace invalid sequences with U+FFFD
    • Added support for latin1/binary encodings (0x00-0xFF mapping)
    • Added ASCII encoding with U+FFFD replacement for non-ASCII bytes
  2. Documentation (README.md, README_zh.md):

    • Added compatibility notes explaining ASCII encoding differences
    • Clarified that Nitro follows Node.js standard (U+FFFD replacement) vs craftzdog (byte discarding)

Key Behavior

✅ UTF-8 decoding now matches Node.js WHATWG standards
✅ Invalid UTF-8 sequences replaced with U+FFFD (�) instead of malformed output
✅ ASCII encoding preserves length with replacement characters
✅ Latin1/Binary encodings for raw byte data handling

The fix ensures compatibility with binary protocols like Microsoft TTS WebSocket that mix text headers with audio data streams.

v0.0.1

17 Dec 11:20

Choose a tag to compare

First release: react-native-nitro-buffer - High-performance Node.js Buffer API implementation for React Native

  • Implement 100% Node.js Buffer API compatibility with pure C++ native code
  • Create high-performance hybrid JS/C++ implementation using NitroModules
  • Add comprehensive benchmark suite showing significant performance improvements:
    • 545x faster fill() operations
    • 84x faster write() operations
    • 691x+ faster toString() operations
    • Optimized base64 encoding/decoding
  • Add detailed documentation (README.md and README_zh.md)