mirror of https://github.com/waku-org/js-waku.git
Replace custom utf-8 convert implementations with `uint8arrays`
This commit is contained in:
parent
6ef0550433
commit
638b96c17d
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue