do not provide unused encoding in constructor

This commit is contained in:
Lewis Moten
2024-05-09 13:58:18 -04:00
parent dca871c463
commit 17ae82e729

View File

@@ -1509,10 +1509,10 @@ function numberToBits(number, bitLength) {
return bits;
}
function bytesToText(bytes) {
return new TextDecoder(encoding).decode(bytes);
return new TextDecoder().decode(bytes);
}
function textToBytes(text) {
return new TextEncoder(encoding).encode(text);
return new TextEncoder().encode(text);
}
function bytesToBits(bytes) {
return bytes.reduce((bits, byte) => [