From 1e696e0f3b3d510acae1160d79887a4fe663911f Mon Sep 17 00:00:00 2001 From: bayernator Date: Tue, 3 Jan 2023 19:10:17 +0100 Subject: [PATCH] increase nprofile, encodeBytes, nprofileEncode string length parameter to 1500 --- nip19.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nip19.ts b/nip19.ts index f90e22c..ef92eb6 100644 --- a/nip19.ts +++ b/nip19.ts @@ -17,7 +17,7 @@ export function decode(nip19: string): { type: string data: ProfilePointer | EventPointer | string } { - let {prefix, words} = bech32.decode(nip19, 1000) + let {prefix, words} = bech32.decode(nip19, 1500) let data = new Uint8Array(bech32.fromWords(words)) if (prefix === 'nprofile') { @@ -87,7 +87,7 @@ export function noteEncode(hex: string): string { function encodeBytes(prefix: string, hex: string): string { let data = secp256k1.utils.hexToBytes(hex) let words = bech32.toWords(data) - return bech32.encode(prefix, words, 1000) + return bech32.encode(prefix, words, 1500) } export function nprofileEncode(profile: ProfilePointer): string { @@ -96,7 +96,7 @@ export function nprofileEncode(profile: ProfilePointer): string { 1: (profile.relays || []).map(url => utf8Encoder.encode(url)) }) let words = bech32.toWords(data) - return bech32.encode('nprofile', words, 1000) + return bech32.encode('nprofile', words, 1500) } export function neventEncode(event: EventPointer): string { @@ -105,7 +105,7 @@ export function neventEncode(event: EventPointer): string { 1: (event.relays || []).map(url => utf8Encoder.encode(url)) }) let words = bech32.toWords(data) - return bech32.encode('nevent', words, 1000) + return bech32.encode('nevent', words, 1500) } function encodeTLV(tlv: TLV): Uint8Array {