increase nprofile, encodeBytes, nprofileEncode string length parameter to 1500

This commit is contained in:
bayernator
2023-01-03 19:10:17 +01:00
committed by fiatjaf
parent 4b36848b2d
commit 1e696e0f3b

View File

@@ -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 {