summaryrefslogtreecommitdiff
path: root/vendor/github.com/tmthrgd/go-hex/hex_other.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2025-03-09 17:47:56 +0100
committerLibravatar Terin Stock <terinjokes@gmail.com>2025-12-01 22:08:04 +0100
commitb1af8fd87760b34e3ff2fd3bda38f211815a0473 (patch)
tree9317fad1a7ec298d7a8d2678e4e422953bbc6f33 /vendor/github.com/tmthrgd/go-hex/hex_other.go
parent[chore] update URLs to forked source (diff)
downloadgotosocial-b1af8fd87760b34e3ff2fd3bda38f211815a0473.tar.xz
[chore] remove vendor
Diffstat (limited to 'vendor/github.com/tmthrgd/go-hex/hex_other.go')
-rw-r--r--vendor/github.com/tmthrgd/go-hex/hex_other.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/tmthrgd/go-hex/hex_other.go b/vendor/github.com/tmthrgd/go-hex/hex_other.go
deleted file mode 100644
index fab232186..000000000
--- a/vendor/github.com/tmthrgd/go-hex/hex_other.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !amd64 gccgo appengine
-
-package hex
-
-// RawEncode encodes src into EncodedLen(len(src))
-// bytes of dst. As a convenience, it returns the number
-// of bytes written to dst, but this value is always EncodedLen(len(src)).
-// RawEncode implements hexadecimal encoding for a given alphabet.
-func RawEncode(dst, src, alpha []byte) int {
- if len(alpha) != 16 {
- panic("invalid alphabet")
- }
-
- encodeGeneric(dst, src, alpha)
- return len(src) * 2
-}
-
-// Decode decodes src into DecodedLen(len(src)) bytes, returning the actual
-// number of bytes written to dst.
-//
-// If Decode encounters invalid input, it returns an error describing the failure.
-func Decode(dst, src []byte) (int, error) {
- if len(src)%2 == 1 {
- return 0, errLength
- }
-
- if n, ok := decodeGeneric(dst, src); !ok {
- return 0, InvalidByteError(src[n])
- }
-
- return len(src) / 2, nil
-}