From 638b96c17d64946c9e959814b62db613fdab902c Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 25 Mar 2022 16:14:42 +1100 Subject: [PATCH] Replace custom utf-8 convert implementations with `uint8arrays` --- src/lib/utf8.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/utf8.ts b/src/lib/utf8.ts index 3d2db495c0..f627566fed 100644 --- a/src/lib/utf8.ts +++ b/src/lib/utf8.ts @@ -4,10 +4,9 @@ import { fromString } from "uint8arrays/from-string"; import { toString } from "uint8arrays/to-string"; -export const bytesToUtf8 = (bytes: Uint8Array): string => - toString(bytes, "utf-8"); +export const bytesToUtf8 = (b: Uint8Array): string => toString(b, "utf8"); /** * Encode utf-8 string to byte array */ -export const utf8ToBytes = (s: string): Uint8Array => fromString(s, "utf-8"); +export const utf8ToBytes = (s: string): Uint8Array => fromString(s, "utf8");