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 (
"bytes"
"encoding/base64"
"errors"
"fmt"
"io"
"os"
"strings"
"github.com/emmansun/base64"
"github.com/kovidgoyal/kitty/tools/tty"
"github.com/kovidgoyal/kitty/tools/tui/loop"
"github.com/kovidgoyal/kitty/tools/utils"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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