replace all ocurrences of encoding/json with json-iterator so we get rid of HTML escaping and hopefully get faster too.

This commit is contained in:
fiatjaf
2024-12-03 00:49:27 -03:00
parent 6f778f85ba
commit 72d9aac9b1
24 changed files with 39 additions and 35 deletions

View File

@@ -2,13 +2,16 @@ package nip46
import (
"context"
"encoding/json"
"regexp"
jsoniter "github.com/json-iterator/go"
"github.com/nbd-wtf/go-nostr"
)
var BUNKER_REGEX = regexp.MustCompile(`^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$`)
var (
BUNKER_REGEX = regexp.MustCompile(`^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$`)
json = jsoniter.ConfigFastest
)
type Request struct {
ID string `json:"id"`