use xhex everywhere.

This commit is contained in:
fiatjaf
2025-11-21 21:16:34 -03:00
parent 61b9717c5c
commit 55a43e46b7
46 changed files with 185 additions and 177 deletions

View File

@@ -2,7 +2,6 @@ package blossom
import (
"context"
"encoding/hex"
"fmt"
"fiatjaf.com/nostr"
@@ -16,7 +15,7 @@ func (c *Client) List(ctx context.Context) ([]BlobDescriptor, error) {
}
bds := make([]BlobDescriptor, 0, 100)
err = c.httpCall(ctx, "GET", "list/"+hex.EncodeToString(pubkey[:]), "", func() string {
err = c.httpCall(ctx, "GET", "list/"+nostr.HexEncodeToString(pubkey[:]), "", func() string {
return c.authorizationHeader(ctx, func(evt *nostr.Event) {
evt.Tags = append(evt.Tags, nostr.Tag{"t", "list"})
})

View File

@@ -3,7 +3,6 @@ package blossom
import (
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"mime"
@@ -47,7 +46,7 @@ func (c *Client) UploadBlob(ctx context.Context, file io.ReadSeeker, contentType
err = c.httpCall(ctx, "PUT", "upload", contentType, func() string {
return c.authorizationHeader(ctx, func(evt *nostr.Event) {
evt.Tags = append(evt.Tags, nostr.Tag{"t", "upload"})
evt.Tags = append(evt.Tags, nostr.Tag{"x", hex.EncodeToString(hash[:])})
evt.Tags = append(evt.Tags, nostr.Tag{"x", nostr.HexEncodeToString(hash[:])})
})
}, file, size, &bd)
if err != nil {