File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1752
1752
return out . flip ( ) ;
1753
1753
} ;
1754
1754
1755
+ // NOTE on binary strings: Binary strings as used here have nothing to do with frequently asked questions about
1756
+ // conversion between ArrayBuffer and String. What we do here is what libraries like node-forge do to simulate a
1757
+ // byte buffer: Conversion between 8 bit unsigned integers and the low 8 bit UTF8/UCS2 characters. This is not
1758
+ // perfect as it effectively uses 16 bit per character in memory to store the 8 bit values, but that's not our
1759
+ // concern as we just want it to be compatible. It's always better to use ArrayBuffer/Buffer (!) while base64
1760
+ // and hex should be slightly worse regarding memory consumption and encoding speed.
1761
+
1755
1762
/**
1756
1763
* Encodes a ByteBuffer to a binary string. A binary string in this case is a string composed of 8bit values
1757
1764
* as characters with a char code between 0 and 255 inclusive.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1661
1661
return out . flip ( ) ;
1662
1662
} ;
1663
1663
1664
+ // NOTE on binary strings: Binary strings as used here have nothing to do with frequently asked questions about
1665
+ // conversion between ArrayBuffer and String. What we do here is what libraries like node-forge do to simulate a
1666
+ // byte buffer: Conversion between 8 bit unsigned integers and the low 8 bit UTF8/UCS2 characters. This is not
1667
+ // perfect as it effectively uses 16 bit per character in memory to store the 8 bit values, but that's not our
1668
+ // concern as we just want it to be compatible. It's always better to use ArrayBuffer/Buffer (!) while base64
1669
+ // and hex should be slightly worse regarding memory consumption and encoding speed.
1670
+
1664
1671
/**
1665
1672
* Encodes a ByteBuffer to a binary string. A binary string in this case is a string composed of 8bit values
1666
1673
* as characters with a char code between 0 and 255 inclusive.
Original file line number Diff line number Diff line change 1752
1752
return out . flip ( ) ;
1753
1753
} ;
1754
1754
1755
+ // NOTE on binary strings: Binary strings as used here have nothing to do with frequently asked questions about
1756
+ // conversion between ArrayBuffer and String. What we do here is what libraries like node-forge do to simulate a
1757
+ // byte buffer: Conversion between 8 bit unsigned integers and the low 8 bit UTF8/UCS2 characters. This is not
1758
+ // perfect as it effectively uses 16 bit per character in memory to store the 8 bit values, but that's not our
1759
+ // concern as we just want it to be compatible. It's always better to use ArrayBuffer/Buffer (!) while base64
1760
+ // and hex should be slightly worse regarding memory consumption and encoding speed.
1761
+
1755
1762
/**
1756
1763
* Encodes a ByteBuffer to a binary string. A binary string in this case is a string composed of 8bit values
1757
1764
* as characters with a char code between 0 and 255 inclusive.
You can’t perform that action at this time.
0 commit comments