Use SIMD base64 everywhere

This commit is contained in:
Kovid Goyal
2026-04-21 11:56:55 +05:30
parent 744ad7438c
commit 3d8a2fbb4f
16 changed files with 34 additions and 22 deletions

View File

@@ -4,13 +4,14 @@ package clipboard
import ( import (
"bytes" "bytes"
"encoding/base64"
"errors" "errors"
"fmt" "fmt"
"io" "io"
"os" "os"
"strings" "strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"

View File

@@ -4,7 +4,6 @@ package clipboard
import ( import (
"bytes" "bytes"
"encoding/base64"
"fmt" "fmt"
"image" "image"
"io" "io"
@@ -14,6 +13,8 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"

View File

@@ -3,7 +3,6 @@
package clipboard package clipboard
import ( import (
"encoding/base64"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@@ -12,6 +11,8 @@ import (
"slices" "slices"
"strings" "strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"
) )

View File

@@ -2,7 +2,6 @@ package notify
import ( import (
"bytes" "bytes"
"encoding/base64"
"fmt" "fmt"
"image" "image"
"io" "io"
@@ -12,6 +11,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/cli" "github.com/kovidgoyal/kitty/tools/cli"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"

View File

@@ -7,7 +7,6 @@ import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"context" "context"
"encoding/base64"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@@ -28,9 +27,11 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/kovidgoyal/kitty" "github.com/emmansun/base64"
"golang.org/x/sys/unix"
"github.com/kovidgoyal/go-shm" "github.com/kovidgoyal/go-shm"
"github.com/kovidgoyal/kitty"
"github.com/kovidgoyal/kitty/tools/cli" "github.com/kovidgoyal/kitty/tools/cli"
"github.com/kovidgoyal/kitty/tools/themes" "github.com/kovidgoyal/kitty/tools/themes"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
@@ -40,8 +41,6 @@ import (
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"
"github.com/kovidgoyal/kitty/tools/utils/secrets" "github.com/kovidgoyal/kitty/tools/utils/secrets"
"github.com/kovidgoyal/kitty/tools/utils/shlex" "github.com/kovidgoyal/kitty/tools/utils/shlex"
"golang.org/x/sys/unix"
) )
var _ = fmt.Print var _ = fmt.Print

View File

@@ -3,7 +3,6 @@
package transfer package transfer
import ( import (
"encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/fs" "io/fs"
@@ -14,6 +13,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty" "github.com/kovidgoyal/kitty"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"
) )

View File

@@ -1,12 +1,13 @@
package at package at
import ( import (
"encoding/base64"
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"os" "os"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
) )

View File

@@ -3,15 +3,17 @@
package at package at
import ( import (
"encoding/base64"
"errors" "errors"
"io"
"os"
"strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"
"github.com/kovidgoyal/kitty/tools/utils/shlex" "github.com/kovidgoyal/kitty/tools/utils/shlex"
"io"
"os"
"strings"
) )
var end_reading_from_stdin = errors.New("end reading from STDIN") var end_reading_from_stdin = errors.New("end reading from STDIN")

View File

@@ -4,13 +4,14 @@ package at
import ( import (
"bytes" "bytes"
"encoding/base64"
"fmt" "fmt"
"image" "image"
"io" "io"
"os" "os"
"strings" "strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/utils/images" "github.com/kovidgoyal/kitty/tools/utils/images"
) )

View File

@@ -4,7 +4,6 @@ package edit_in_kitty
import ( import (
"bytes" "bytes"
"encoding/base64"
"fmt" "fmt"
"io" "io"
"io/fs" "io/fs"
@@ -12,6 +11,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/emmansun/base64"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/kovidgoyal/kitty/tools/cli" "github.com/kovidgoyal/kitty/tools/cli"

View File

@@ -3,13 +3,14 @@
package mouse_demo package mouse_demo
import ( import (
"encoding/base64"
"fmt" "fmt"
"net/url" "net/url"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty" "github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop" "github.com/kovidgoyal/kitty/tools/tui/loop"
) )

View File

@@ -3,7 +3,6 @@
package tty package tty
import ( import (
"encoding/base64"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@@ -12,6 +11,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/emmansun/base64"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"

View File

@@ -3,9 +3,10 @@
package tui package tui
import ( import (
"encoding/base64"
"fmt" "fmt"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/utils" "github.com/kovidgoyal/kitty/tools/utils"
) )

View File

@@ -5,12 +5,13 @@ package graphics
import ( import (
"bytes" "bytes"
"compress/zlib" "compress/zlib"
"encoding/base64"
"fmt" "fmt"
"io" "io"
"strings" "strings"
"testing" "testing"
"github.com/emmansun/base64"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"golang.org/x/exp/rand" "golang.org/x/exp/rand"
) )

View File

@@ -5,13 +5,13 @@ package loop
import ( import (
"crypto/hmac" "crypto/hmac"
"crypto/sha256" "crypto/sha256"
"encoding/base64"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"os" "os"
"strings" "strings"
"time" "time"
"github.com/emmansun/base64"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"github.com/kovidgoyal/go-parallel" "github.com/kovidgoyal/go-parallel"

View File

@@ -4,9 +4,10 @@ package secrets
import ( import (
"crypto/rand" "crypto/rand"
"encoding/base64"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/emmansun/base64"
) )
var _ = fmt.Print var _ = fmt.Print