From dca871c463fa535eecde2a43184dfafc65bdb618 Mon Sep 17 00:00:00 2001 From: Lewis Moten Date: Thu, 9 May 2024 13:11:48 -0400 Subject: [PATCH] Only UTF-8 Supported --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ca9351a..960ec60 100644 --- a/index.js +++ b/index.js @@ -1508,10 +1508,10 @@ function numberToBits(number, bitLength) { bits.push((number >> i) & 1); return bits; } -function bytesToText(bytes, encoding='utf-8') { +function bytesToText(bytes) { return new TextDecoder(encoding).decode(bytes); } -function textToBytes(text, encoding='utf-8') { +function textToBytes(text) { return new TextEncoder(encoding).encode(text); } function bytesToBits(bytes) {