forked from tornado-packages/noble-curves
Fix utf8ToBytes in firefox extension context
This commit is contained in:
parent
c6b4aadafb
commit
b281167e8d
@ -140,7 +140,7 @@ declare const TextEncoder: any;
|
|||||||
*/
|
*/
|
||||||
export function utf8ToBytes(str: string): Uint8Array {
|
export function utf8ToBytes(str: string): Uint8Array {
|
||||||
if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
|
if (typeof str !== 'string') throw new Error(`utf8ToBytes expected string, got ${typeof str}`);
|
||||||
return new TextEncoder().encode(str);
|
return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bit operations
|
// Bit operations
|
||||||
|
Loading…
Reference in New Issue
Block a user