张富强 5 months ago
parent
commit
ac3c996d93

+ 10 - 0
bytes/main.go

@@ -3,8 +3,18 @@ package yu_bytes
 import (
 	"bytes"
 	yu_fast "gogs.qqck.cn/s/go-tools/fast"
+	"unsafe"
 )
 
+func Equals(val ...[]byte) bool {
+	for j_i := 1; j_i < len(val); j_i++ {
+		if *(*string)(unsafe.Pointer(&val[0])) != *(*string)(unsafe.Pointer(&val[j_i])) {
+			return false
+		}
+	}
+	return true
+}
+
 // Lines
 //
 //	@Description: 寻找数据

+ 2 - 3
curl/request_windows.go

@@ -3,7 +3,6 @@
 package yu_curl
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_http "gogs.qqck.cn/s/go-tools/http"
 	yu_strings "gogs.qqck.cn/s/go-tools/strings"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
@@ -229,7 +228,7 @@ func (t *Request) GetHeaders() string {
 		j_headers = append(j_headers, j_value...)
 		j_headers = append(j_headers, 13, 10)
 	}
-	return yu_fast.B2S(j_headers)
+	return string(j_headers)
 }
 
 // -----------------------------------------------------------------------------------------------------------------------------------------------Content-Type
@@ -352,7 +351,7 @@ func (t *Request) GetCookies() string {
 		j_cookies = append(j_cookies, ';')
 		j_cookies = append(j_cookies, ' ')
 	}
-	return yu_fast.B2S(j_cookies)
+	return string(j_cookies)
 }
 
 // SetAutoCookies

+ 4 - 5
curl/response_windows.go

@@ -4,7 +4,6 @@ package yu_curl
 
 import (
 	"errors"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_http "gogs.qqck.cn/s/go-tools/http"
 )
 
@@ -65,7 +64,7 @@ func (t *Request) RespCookies() string {
 		j_cookies = append(j_cookies, ';')
 		j_cookies = append(j_cookies, ' ')
 	}
-	return yu_fast.B2S(j_cookies)
+	return string(j_cookies)
 }
 
 // -----------------------------------------------------------------------------------------------------------------------------------------------Headers
@@ -97,14 +96,14 @@ func (t *Request) RespHeaders() string {
 		j_headers = append(j_headers, j_value...)
 		j_headers = append(j_headers, 13, 10)
 	}
-	return yu_fast.B2S(j_headers)
+	return string(j_headers)
 }
 
 // RespHeadersRaw
 //
 //	@Description: 获取全部响应原始 Headers 数据
 func (t *Request) RespHeadersRaw() string {
-	return yu_fast.B2S(t.resp_headers_raw)
+	return string(t.resp_headers_raw)
 }
 
 // -----------------------------------------------------------------------------------------------------------------------------------------------Utils
@@ -136,5 +135,5 @@ func (t *Request) RespBody() []byte {
 //
 //	@Description: 获取响应数据
 func (t *Request) RespBodyS() string {
-	return yu_fast.B2S(t.resp_body)
+	return string(t.resp_body)
 }

+ 1 - 3
file/api_windows_x32.go

@@ -3,15 +3,13 @@
 package yu_file
 
 import (
-	yu_strings "gogs.qqck.cn/s/go-tools/strings"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
 	"time"
 )
 
 func openfile(name string, dwDesiredAccess, dwShareMode, dwCreationDisposition, dwFlagsAndAttributes uintptr) uintptr {
-	j_name := yu_strings.Utf8ToUnicodePtr(name)
 _open:
-	j_fd, _, j_errno := yu_win.CreateFileW.Call(j_name, dwDesiredAccess, dwShareMode, 0, dwCreationDisposition, dwFlagsAndAttributes, 0)
+	j_fd, _, j_errno := yu_win.CreateFileW.Call(yu_win.S{yu_win.Unicode, name}, dwDesiredAccess, dwShareMode, 0, dwCreationDisposition, dwFlagsAndAttributes, 0)
 	if j_errno == error_SHARING_VIOLATION {
 		time.Sleep(time.Microsecond)
 		goto _open

+ 1 - 3
file/api_windows_x64.go

@@ -3,15 +3,13 @@
 package yu_file
 
 import (
-	yu_strings "gogs.qqck.cn/s/go-tools/strings"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
 	"time"
 )
 
 func openfile(name string, dwDesiredAccess, dwShareMode, dwCreationDisposition, dwFlagsAndAttributes uintptr) uintptr {
-	j_name := yu_strings.Utf8ToUnicodePtr(name)
 _open:
-	j_fd, _, j_errno := yu_win.CreateFileW.Call(j_name, dwDesiredAccess, dwShareMode, 0, dwCreationDisposition, dwFlagsAndAttributes, 0)
+	j_fd, _, j_errno := yu_win.CreateFileW.Call(yu_win.S{yu_win.Unicode, name}, dwDesiredAccess, dwShareMode, 0, dwCreationDisposition, dwFlagsAndAttributes, 0)
 	if j_errno == error_SHARING_VIOLATION {
 		time.Sleep(time.Microsecond)
 		goto _open

+ 1 - 11
file/dir_windows.go

@@ -3,9 +3,7 @@
 package yu_file
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_math "gogs.qqck.cn/s/go-tools/math"
-	yu_strings "gogs.qqck.cn/s/go-tools/strings"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
 	"strings"
 	"syscall"
@@ -20,14 +18,6 @@ func MkDirs(path string) bool {
 	return j_code == 0 || j_code == yu_win.ERROR_FILE_EXISTS || j_code == yu_win.ERROR_ALREADY_EXISTS
 }
 
-// TempDir
-//
-//	@Description: 取系统临时目录路径
-func TempDir() string {
-	j_buf := make([]byte, 522)
-	return yu_strings.UnicodeToUtf8(yu_fast.B2S(j_buf[:yu_win.GetTempPathW.CallInt(256, j_buf)*2]))
-}
-
 // Find
 //
 //	@Description: 基础对象
@@ -173,5 +163,5 @@ func (t *Find) findEnum(path, name, parent string, start, count int) []string {
 func unicode_utf8(unicode [520]byte) string {
 	j_utf8_size := yu_win.WideCharToMultiByte.CallInt(65001, 0, unicode[:], -1, 0, 0, 0, 0) * 3
 	j_utf8 := make([]byte, j_utf8_size)
-	return yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, unicode[:], -1, j_utf8, j_utf8_size, 0, 0)-1])
+	return string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, unicode[:], -1, j_utf8, j_utf8_size, 0, 0)-1])
 }

+ 4 - 4
file/extend_windows.go

@@ -113,7 +113,7 @@ func Lines(name string, sep []byte) (result int64) {
 	}
 	defer yu_win.CloseHandle.Call(j_fd)
 	j_buf, j_buf_n, j_buf_move := make([]byte, lines_size), int64(0), int64(0)
-	j_sep, j_sep_len := yu_fast.B2S(sep), int64(len(sep))
+	j_sep_len := int64(len(sep))
 	for {
 		if j_buf_n = readFileBuf(j_fd, j_buf[j_buf_move:]); j_buf_n == 0 {
 			if j_buf_move > 0 {
@@ -123,7 +123,7 @@ func Lines(name string, sep []byte) (result int64) {
 		}
 		result += yu_bytes.Lines(j_buf[:j_buf_move+j_buf_n], sep)
 		if j_buf_n > j_sep_len {
-			if yu_fast.B2S(j_buf[:j_buf_n][j_buf_n-j_sep_len:]) == j_sep {
+			if yu_bytes.Equals(j_buf[:j_buf_n][j_buf_n-j_sep_len:], sep) {
 				j_buf_move = 0
 			} else {
 				j_buf_move = j_sep_len
@@ -268,7 +268,7 @@ func ForGet(name string, eof []byte, min, max int64, seek_get func() ForInfo, se
 	}
 	defer yu_win.CloseHandle.Call(j_fd)
 	j_info := seek_get()
-	j_eof, j_eof_len := yu_fast.B2S(eof), int64(len(eof))
+	j_eof_len := int64(len(eof))
 	if j_info.Size < 0 && !yu_win.GetFileSizeEx.CallBool(j_fd, &j_info.Size) {
 		return nil
 	}
@@ -301,7 +301,7 @@ _get:
 			if j_get_size == 0 || j_get_size < j_eof_len {
 				return nil
 			}
-			if yu_fast.B2S(j_result) == j_eof {
+			if yu_bytes.Equals(j_result, eof) {
 				break
 			}
 			if min++; min > max {

+ 1 - 1
file/main_windows.go

@@ -32,7 +32,7 @@ func Get(name string) (result []byte) {
 //	@Description: 独占方式(多线程安全)读文件
 //	@param name 文件路径
 func GetS(name string) string {
-	return yu_fast.B2S(Get(name))
+	return string(Get(name))
 }
 
 // Set

+ 0 - 1
file/main_windows_test.go

@@ -11,7 +11,6 @@ func TestGetS(t *testing.T) {
 	fmt.Println(GetS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\go.mod"))
 	fmt.Println(SetS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\build.txt", "1sadasdasd"))
 	fmt.Println(LinesS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\build.txt", "\r\n"))
-	fmt.Println(TempDir())
 }
 
 func TestFind_Enum(t *testing.T) {

+ 0 - 26
file/main_windows_x32.go

@@ -1,26 +0,0 @@
-//go:build windows && (386 || arm || mips || mipsle)
-
-package yu_file
-
-import (
-	yu_win "gogs.qqck.cn/s/go-tools/win"
-)
-
-// Write
-//
-//	@Description: (非多线程安全)写出文件
-//	@param name 文件路径
-//	@param bufs 写出内容...
-func Write(name string, bufs ...[]byte) bool {
-	j_fd, _, _ := yu_win.CreateFileW.Call(yu_win.S{yu_win.Unicode, name}, yu_win.GENERIC_WRITE, yu_win.FILE_SHARE_NO, 0, yu_win.CREATE_ALWAYS, yu_win.FILE_FLAG_WRITE_THROUGH, 0)
-	if int32(j_fd) == -1 {
-		return false
-	}
-	defer yu_win.CloseHandle.Call(j_fd)
-	for j_i := 0; j_i < len(bufs); j_i++ {
-		if !writeFile(j_fd, bufs[j_i]) {
-			return false
-		}
-	}
-	return true
-}

+ 0 - 26
file/main_windows_x64.go

@@ -1,26 +0,0 @@
-//go:build windows && (amd64 || arm64 || ppc64 || ppc64le || s390x || mips64 || mips64le)
-
-package yu_file
-
-import (
-	yu_win "gogs.qqck.cn/s/go-tools/win"
-)
-
-// Write
-//
-//	@Description: (非多线程安全)写出文件
-//	@param name 文件路径
-//	@param bufs 写出内容...
-func Write(name string, bufs ...[]byte) bool {
-	j_fd, _, _ := yu_win.CreateFileW.Call(yu_win.S{yu_win.Unicode, name}, yu_win.GENERIC_WRITE, yu_win.FILE_SHARE_NO, 0, yu_win.CREATE_ALWAYS, yu_win.FILE_FLAG_WRITE_THROUGH, 0)
-	if int64(j_fd) == -1 {
-		return false
-	}
-	defer yu_win.CloseHandle.Call(j_fd)
-	for j_i := 0; j_i < len(bufs); j_i++ {
-		if !writeFile(j_fd, bufs[j_i]) {
-			return false
-		}
-	}
-	return true
-}

+ 2 - 3
hex/main.go

@@ -2,7 +2,6 @@ package yu_hex
 
 import (
 	yu_const "gogs.qqck.cn/s/go-tools/const"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 )
 
 // Lower
@@ -14,7 +13,7 @@ func Lower(buf []byte) string {
 		j_buf = append(j_buf, yu_const.HexLower[j_byte>>4])
 		j_buf = append(j_buf, yu_const.HexLower[j_byte&0x0f])
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }
 
 // Upper
@@ -26,7 +25,7 @@ func Upper(buf []byte) string {
 		j_buf = append(j_buf, yu_const.HexUpper[j_byte>>4])
 		j_buf = append(j_buf, yu_const.HexUpper[j_byte&0x0f])
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }
 
 const _reverseHexTable = "" +

+ 2 - 3
hpsocket/client_windows.go

@@ -3,7 +3,6 @@
 package yu_hpsocket
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_net "gogs.qqck.cn/s/go-tools/net"
 	yu_proxy "gogs.qqck.cn/s/go-tools/proxy"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
@@ -263,7 +262,7 @@ func (t *Client[T]) GetLocalAddress() (address string, port int) {
 
 	j_utf8_size := j_unicode_len * 2
 	j_utf8 := make([]byte, j_utf8_size)
-	address = yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
+	address = string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
 	return
 }
 
@@ -286,7 +285,7 @@ func (t *Client[T]) GetRemoteHost() (address string, port int) {
 
 	j_utf8_size := j_unicode_len * 2
 	j_utf8 := make([]byte, j_utf8_size)
-	address = yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
+	address = string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
 	return
 }
 

+ 1 - 2
hpsocket/client_windows_extend.go

@@ -4,7 +4,6 @@ package yu_hpsocket
 
 import (
 	yu_base64 "gogs.qqck.cn/s/go-tools/base64"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_net "gogs.qqck.cn/s/go-tools/net"
 	yu_proxy "gogs.qqck.cn/s/go-tools/proxy"
 	yu_strconv "gogs.qqck.cn/s/go-tools/strconv"
@@ -56,7 +55,7 @@ func (t *Client[T]) connect_proxy() bool {
 			return false
 		}
 		// "HTTP/1.1 200 Connection Established"、"HTTP/1.1 200 Connection established"
-		if len(j_buf) < 16 || yu_fast.B2S(j_buf[9:12]) != "200" {
+		if len(j_buf) < 16 || string(j_buf[9:12]) != "200" {
 			t.Stop()
 			return false
 		}

+ 3 - 4
hpsocket/server_windows.go

@@ -3,7 +3,6 @@
 package yu_hpsocket
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
 )
 
@@ -292,7 +291,7 @@ func (t *Server[T]) GetListenAddress() (address string, port int) {
 
 	j_utf8_size := j_unicode_len * 2
 	j_utf8 := make([]byte, j_utf8_size)
-	address = yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
+	address = string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
 	return
 }
 
@@ -316,7 +315,7 @@ func (t *Server[T]) GetLocalAddress(ConnID uintptr) (address string, port int) {
 
 	j_utf8_size := j_unicode_len * 2
 	j_utf8 := make([]byte, j_utf8_size)
-	address = yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
+	address = string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
 	return
 }
 
@@ -340,7 +339,7 @@ func (t *Server[T]) GetRemoteAddress(ConnID uintptr) (address string, port int)
 
 	j_utf8_size := j_unicode_len * 2
 	j_utf8 := make([]byte, j_utf8_size)
-	address = yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
+	address = string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, j_address_len, j_utf8, j_utf8_size, 0, 0)])
 	return
 }
 

+ 1 - 5
http/main.go

@@ -1,9 +1,5 @@
 package yu_http
 
-import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
-)
-
 const toLower = 'a' - 'A'
 
 func Normalize(key string) string {
@@ -19,5 +15,5 @@ func Normalize(key string) string {
 		}
 		j_upper = key[j_i] == '-' // for next time
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }

+ 2 - 3
io/read.go

@@ -1,7 +1,6 @@
 package yu_io
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	"io"
 )
 
@@ -27,7 +26,7 @@ func ReadAll(r io.Reader) []byte {
 //
 //	@Description: 从流中读取所有数据
 func ReadAllS(r io.Reader) string {
-	return yu_fast.B2S(ReadAll(r))
+	return string(ReadAll(r))
 }
 
 // ReadAllClose
@@ -42,5 +41,5 @@ func ReadAllClose(r io.ReadCloser) []byte {
 //
 //	@Description: 从流中读取所有数据并关闭流
 func ReadAllSClose(r io.ReadCloser) string {
-	return yu_fast.B2S(ReadAllClose(r))
+	return string(ReadAllClose(r))
 }

+ 19 - 19
math/const.go

@@ -21,30 +21,30 @@ const (
 // Max is the largest finite value representable by the type.
 // SmallestNonzero is the smallest positive, non-zero value representable by the type.
 const (
-	MaxFloat32             float32 = 0x1p127 * (1 + (1 - 0x1p-23)) // 3.40282346638528859811704183484516925440e+38
-	SmallestNonzeroFloat32 float32 = 0x1p-126 * 0x1p-23            // 1.401298464324817070923729583289916131280e-45
+	MaxFloat32             = 0x1p127 * (1 + (1 - 0x1p-23)) // 3.40282346638528859811704183484516925440e+38
+	SmallestNonzeroFloat32 = 0x1p-126 * 0x1p-23            // 1.401298464324817070923729583289916131280e-45
 
-	MaxFloat64             float64 = 0x1p1023 * (1 + (1 - 0x1p-52)) // 1.79769313486231570814527423731704356798070e+308
-	SmallestNonzeroFloat64 float64 = 0x1p-1022 * 0x1p-52            // 4.9406564584124654417656879286822137236505980e-324
+	MaxFloat64             = 0x1p1023 * (1 + (1 - 0x1p-52)) // 1.79769313486231570814527423731704356798070e+308
+	SmallestNonzeroFloat64 = 0x1p-1022 * 0x1p-52            // 4.9406564584124654417656879286822137236505980e-324
 )
 
 // Integer limit values.
 const (
 	IntSize = 32 << (^uint(0) >> 63) // 32 or 64
 
-	MaxInt    int    = 1<<(IntSize-1) - 1  // MaxInt32 or MaxInt64 depending on IntSize.
-	MinInt    int    = -1 << (IntSize - 1) // MinInt32 or MinInt64 depending on IntSize.
-	MaxInt8   int8   = 1<<7 - 1            // 127
-	MinInt8   int8   = -1 << 7             // -128
-	MaxInt16  int16  = 1<<15 - 1           // 32767
-	MinInt16  int16  = -1 << 15            // -32768
-	MaxInt32  int32  = 1<<31 - 1           // 2147483647
-	MinInt32  int32  = -1 << 31            // -2147483648
-	MaxInt64  int64  = 1<<63 - 1           // 9223372036854775807
-	MinInt64  int64  = -1 << 63            // -9223372036854775808
-	MaxUint   uint   = 1<<IntSize - 1      // MaxUint32 or MaxUint64 depending on IntSize.
-	MaxUint8  uint8  = 1<<8 - 1            // 255
-	MaxUint16 uint16 = 1<<16 - 1           // 65535
-	MaxUint32 uint32 = 1<<32 - 1           // yu_math.MaxUint
-	MaxUint64 uint64 = 1<<64 - 1           // 18446744073709551615
+	MaxInt    = 1<<(IntSize-1) - 1  // MaxInt32 or MaxInt64 depending on IntSize.
+	MinInt    = -1 << (IntSize - 1) // MinInt32 or MinInt64 depending on IntSize.
+	MaxInt8   = 1<<7 - 1            // 127
+	MinInt8   = -1 << 7             // -128
+	MaxInt16  = 1<<15 - 1           // 32767
+	MinInt16  = -1 << 15            // -32768
+	MaxInt32  = 1<<31 - 1           // 2147483647
+	MinInt32  = -1 << 31            // -2147483648
+	MaxInt64  = 1<<63 - 1           // 9223372036854775807
+	MinInt64  = -1 << 63            // -9223372036854775808
+	MaxUint   = 1<<IntSize - 1      // MaxUint32 or MaxUint64 depending on IntSize.
+	MaxUint8  = 1<<8 - 1            // 255
+	MaxUint16 = 1<<16 - 1           // 65535
+	MaxUint32 = 1<<32 - 1           // yu_math.MaxUint
+	MaxUint64 = 1<<64 - 1           // 18446744073709551615
 )

+ 1 - 3
pack/main.go

@@ -1,7 +1,5 @@
 package yu_pack
 
-import yu_fast "gogs.qqck.cn/s/go-tools/fast"
-
 // Pack
 // @Description: Pack 底层实现
 type Pack struct {
@@ -63,7 +61,7 @@ func (t *Pack) SetBytes(buf []byte) *Pack {
 //
 //	@Description: 返回缓冲区总数据的字符串
 func (t *Pack) String() string {
-	return yu_fast.B2S(t.buf)
+	return string(t.buf)
 }
 
 // Bytes

+ 9 - 10
pack/pop.go

@@ -1,7 +1,6 @@
 package yu_pack
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	"io"
 )
 
@@ -399,7 +398,7 @@ func (t *Pack) PopString(n int) (result string, err error) {
 		return
 	}
 	if n < 0 {
-		result = yu_fast.B2S(t.buf[t.get_i:])
+		result = string(t.buf[t.get_i:])
 		t.get_i = len(t.buf)
 		return
 	}
@@ -407,7 +406,7 @@ func (t *Pack) PopString(n int) (result string, err error) {
 		err = io.EOF
 		return
 	}
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+n])
+	result = string(t.buf[t.get_i : t.get_i+n])
 	t.get_i += n
 	return
 }
@@ -427,7 +426,7 @@ func (t *Pack) PopStringByte(add int) (result string, err error) {
 		return
 	}
 	t.get_i++
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -447,7 +446,7 @@ func (t *Pack) PopStringInt16L(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 2
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -467,7 +466,7 @@ func (t *Pack) PopStringInt16B(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 2
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -488,7 +487,7 @@ func (t *Pack) PopStringInt32L(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 4
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -509,7 +508,7 @@ func (t *Pack) PopStringInt32B(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 4
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -532,7 +531,7 @@ func (t *Pack) PopStringInt64L(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 8
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }
@@ -555,7 +554,7 @@ func (t *Pack) PopStringInt64B(add int) (result string, err error) {
 		return
 	}
 	t.get_i += 8
-	result = yu_fast.B2S(t.buf[t.get_i : t.get_i+j_n])
+	result = string(t.buf[t.get_i : t.get_i+j_n])
 	t.get_i += j_n
 	return
 }

+ 3 - 5
path/main.go

@@ -1,7 +1,5 @@
 package yu_path
 
-import yu_fast "gogs.qqck.cn/s/go-tools/fast"
-
 // Format
 //
 //	@Description: 格式化文件或目录名称,去除所有转义符及不合规符号
@@ -32,7 +30,7 @@ func Format(s string) string {
 		return ""
 	}
 	j_eof++
-	return yu_fast.B2S(j_buf[:j_eof])
+	return string(j_buf[:j_eof])
 }
 
 // Join
@@ -51,7 +49,7 @@ func Join(s ...string) string {
 		j_buf = append(j_buf, '\\')
 		j_buf = append(j_buf, s[j_i]...)
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }
 
 // JoinFormat
@@ -70,5 +68,5 @@ func JoinFormat(s ...string) string {
 		j_buf = append(j_buf, '\\')
 		j_buf = append(j_buf, Format(s[j_i])...)
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }

+ 0 - 10
path/main_windows.go

@@ -3,19 +3,9 @@
 package yu_path
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
-	yu_strings "gogs.qqck.cn/s/go-tools/strings"
 	yu_win "gogs.qqck.cn/s/go-tools/win"
 )
 
-// Abs
-//
-//	@Description: 返回路径的绝对表示。如果路径不是绝对路径,它将与当前路径连接工作目录,将其转换为绝对路径。绝对给定文件的路径名不能保证是唯一的。
-func Abs(s string) string {
-	j_buf := make([]byte, 522)
-	return yu_strings.UnicodeToUtf8(yu_fast.B2S(j_buf[:yu_win.GetFullPathNameW.CallInt(yu_win.S{yu_win.Unicode, s}, 260, j_buf)*2]))
-}
-
 // IsFile
 //
 //	@Description: 判断给定路径是否是文件类型

+ 1 - 2
proto/json.go

@@ -2,7 +2,6 @@ package yu_proto
 
 import (
 	yu_base64 "gogs.qqck.cn/s/go-tools/base64"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_strconv "gogs.qqck.cn/s/go-tools/strconv"
 	"strconv"
 )
@@ -10,7 +9,7 @@ import (
 func (t *Protobuf) Json() string {
 	t.tmp_buf = make([]byte, 0, t.maxsize)
 	t.json_obj(t.list)
-	return yu_fast.B2S(t.tmp_buf)
+	return string(t.tmp_buf)
 }
 
 func (t *Protobuf) json_obj(list *node) {

+ 1 - 2
proto/json_info.go

@@ -2,7 +2,6 @@ package yu_proto
 
 import (
 	yu_base64 "gogs.qqck.cn/s/go-tools/base64"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_strconv "gogs.qqck.cn/s/go-tools/strconv"
 	"strconv"
 )
@@ -10,7 +9,7 @@ import (
 func (t *Protobuf) JsonInfo() string {
 	t.tmp_buf = make([]byte, 0, t.maxsize)
 	t.json_info_obj(t.list)
-	return yu_fast.B2S(t.tmp_buf)
+	return string(t.tmp_buf)
 }
 
 func (t *Protobuf) json_info_obj(list *node) {

+ 2 - 3
proxy/info_windows.go

@@ -4,7 +4,6 @@ package yu_proxy
 
 import (
 	yu_curl "gogs.qqck.cn/s/go-tools/curl"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_json "gogs.qqck.cn/s/go-tools/json"
 	yu_net "gogs.qqck.cn/s/go-tools/net"
 	yu_rand "gogs.qqck.cn/s/go-tools/rand"
@@ -120,7 +119,7 @@ func (t *Info) Copy() (info *Info) {
 //
 //	@Description: 编码为"ProxyType://user:pass@host:port",例如:"http://user:pass@127.0.0.1:808"、"socks5://user:pass@127.0.0.1:808"
 func (t *Info) Encode() string {
-	j_buf := make([]byte, 0, 32)
+	j_buf := make([]byte, 0, 64)
 	if t.IsHttp() {
 		j_buf = append(j_buf, "http://"...)
 	} else if t.IsSocks5() {
@@ -133,7 +132,7 @@ func (t *Info) Encode() string {
 		j_buf = append(j_buf, '@')
 	}
 	j_buf = append(j_buf, t.Addr...)
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }
 
 // Internet 是否可链接互联网

+ 20 - 43
rand/extend.go

@@ -2,67 +2,44 @@ package yu_rand
 
 import (
 	yu_const "gogs.qqck.cn/s/go-tools/const"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 )
 
 // Mac
 //
-//	@Description: 随机生成小写 mac
+//	@Description: 随机生成小写 mac (53:31:32:41:c3:dd)
 func Mac() string {
-	return yu_fast.B2S([]byte{
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)], 58,
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)], 58,
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)], 58,
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)], 58,
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)], 58,
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-	})
+	j_mac := make([]byte, 17)
+	Rand.ReadEx(j_mac, yu_const.HexLowerBytes)
+	j_mac[2], j_mac[5], j_mac[8], j_mac[11], j_mac[14] = ':', ':', ':', ':', ':'
+	return string(j_mac)
 }
 
 // MAC
 //
-//	@Description: 随机生成大写 mac
+//	@Description: 随机生成大写 mac (BF:49:00:F6:DB:8E)
 func MAC() string {
-	return yu_fast.B2S([]byte{
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)], 58,
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)], 58,
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)], 58,
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)], 58,
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)], 58,
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-	})
+	j_mac := make([]byte, 17)
+	Rand.ReadEx(j_mac, yu_const.HexUpperBytes)
+	j_mac[2], j_mac[5], j_mac[8], j_mac[11], j_mac[14] = ':', ':', ':', ':', ':'
+	return string(j_mac)
 }
 
 // AndroidId
 //
-//	@Description: 随机生成小写 AndroidId
+//	@Description: 随机生成小写 AndroidId (20f6e8a69f30aebb)
 func AndroidId() string {
-	return yu_fast.B2S([]byte{
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-		yu_const.HexLower[Int31n(16)], yu_const.HexLower[Int31n(16)],
-	})
+	j_mac := make([]byte, 16)
+	Rand.ReadEx(j_mac, yu_const.HexLowerBytes)
+	return string(j_mac)
 }
 
 // AndroidID
 //
-//	@Description: 随机生成大写 AndroidId
+//	@Description: 随机生成大写 AndroidId (5D2D187C36CD84E4)
 func AndroidID() string {
-	return yu_fast.B2S([]byte{
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-		yu_const.HexUpper[Int31n(16)], yu_const.HexUpper[Int31n(16)],
-	})
+	j_mac := make([]byte, 16)
+	Rand.ReadEx(j_mac, yu_const.HexUpperBytes)
+	return string(j_mac)
 }
 
 // AndroidId
@@ -83,7 +60,7 @@ func Imei() string {
 		j_sum += j_toAdd // and even add them here!
 	}
 	j_final[14] = yu_const.HexLower[(j_sum*9)%10] // calculating the control digit
-	return yu_fast.B2S(j_final)
+	return string(j_final)
 }
 
 // Pass
@@ -254,5 +231,5 @@ func Pass(rule string) string {
 			}
 		}
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }

+ 4 - 0
rand/extend_test.go

@@ -6,6 +6,10 @@ import (
 )
 
 func TestPass(t *testing.T) {
+	fmt.Println(Mac())
+	fmt.Println(MAC())
+	fmt.Println(AndroidId())
+	fmt.Println(AndroidID())
 	fmt.Println(Pass("aAbB[2]C[1-3]H"))
 	fmt.Println(Pass("aAbB [2]C [1-3]H"))
 	fmt.Println(Pass("aAbB [2]C [1-3]H"))

+ 9 - 11
rand/strings.go

@@ -1,26 +1,24 @@
 package yu_rand
 
-import yu_fast "gogs.qqck.cn/s/go-tools/fast"
-
 // S09
 //
 //	@Description: 生成 0-9 的随机字符串
 func S09(len int) string {
-	return yu_fast.B2S(BytesEx(len, 10, '0'))
+	return string(BytesEx(len, 10, '0'))
 }
 
 // Saz
 //
 //	@Description: 生成 a-z 的随机字符串
 func Saz(len int) string {
-	return yu_fast.B2S(BytesEx(len, 26, 'a'))
+	return string(BytesEx(len, 26, 'a'))
 }
 
 // SAZ
 //
 //	@Description: 生成 A-Z 的随机字符串
 func SAZ(len int) string {
-	return yu_fast.B2S(BytesEx(len, 26, 'A'))
+	return string(BytesEx(len, 26, 'A'))
 }
 
 // SaZ
@@ -38,7 +36,7 @@ func SaZ(len int) string {
 			bytes[i] = byte(Int31n(26)) + 'A'
 		}
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 // S0az
@@ -56,7 +54,7 @@ func S0az(len int) string {
 			bytes[i] = byte(Int31n(26)) + 'a'
 		}
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 // S0AZ
@@ -74,7 +72,7 @@ func S0AZ(len int) string {
 			bytes[i] = byte(Int31n(26)) + 'A'
 		}
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 // S0aZ
@@ -95,7 +93,7 @@ func S0aZ(len int) string {
 			bytes[i] = byte(Int31n(26)) + 'A'
 		}
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 const str_other = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?"
@@ -110,7 +108,7 @@ func S_(len int) string {
 	for i := 0; i < len; i++ {
 		bytes[i] = str_other[Int31n(str_other_len)]
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 // SEx
@@ -121,7 +119,7 @@ func SEx(len int) string {
 	for i := 0; i < len; i++ {
 		bytes[i] = byte(Int31n(94)) + 33 // 33 - 126
 	}
-	return yu_fast.B2S(bytes)
+	return string(bytes)
 }
 
 // 汉字的 Unicode 编码范围为 \u4E00-\u9FCB \uF900-\uFA2D,如果不在这个范围内就不是汉字。

+ 12 - 16
strconv/main.go

@@ -1,9 +1,5 @@
 package yu_strconv
 
-import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
-)
-
 // ParseInt32
 //
 //	@Description: 解析 s 字符串对应的 i 值,s 可以是 "-" 开头
@@ -140,7 +136,7 @@ func FormatByte(i byte) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatInt8
@@ -162,7 +158,7 @@ func FormatInt8(i int8) string {
 	} else {
 		j_si++
 	}
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUint8
@@ -179,7 +175,7 @@ func FormatUint8(i uint8) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatInt16
@@ -201,7 +197,7 @@ func FormatInt16(i int16) string {
 	} else {
 		j_si++
 	}
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUint16
@@ -218,7 +214,7 @@ func FormatUint16(i uint16) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatInt32
@@ -240,7 +236,7 @@ func FormatInt32(i int32) string {
 	} else {
 		j_si++
 	}
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUint32
@@ -257,7 +253,7 @@ func FormatUint32(i uint32) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatInt64
@@ -279,7 +275,7 @@ func FormatInt64(i int64) string {
 	} else {
 		j_si++
 	}
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUint64
@@ -296,7 +292,7 @@ func FormatUint64(i uint64) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatInt
@@ -318,7 +314,7 @@ func FormatInt(i int) string {
 	} else {
 		j_si++
 	}
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUint
@@ -335,7 +331,7 @@ func FormatUint(i uint) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }
 
 // FormatUintptr
@@ -352,5 +348,5 @@ func FormatUintptr(i uintptr) string {
 		j_si--
 	}
 	j_si++
-	return yu_fast.B2S(j_s[j_si:])
+	return string(j_s[j_si:])
 }

+ 3 - 4
strings/main.go

@@ -1,7 +1,6 @@
 package yu_strings
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	"strings"
 )
 
@@ -87,7 +86,7 @@ func Get09(s string) string {
 			j_buf = append(j_buf, s[j_i])
 		}
 	}
-	return yu_fast.B2S(j_buf)
+	return string(j_buf)
 }
 
 // Get09s
@@ -102,12 +101,12 @@ func Get09s(s string) []string {
 			continue
 		}
 		if len(j_buf) > 0 {
-			j_arr = append(j_arr, yu_fast.B2S(j_buf))
+			j_arr = append(j_arr, string(j_buf))
 			j_buf = make([]byte, 0, len(s))
 		}
 	}
 	if len(j_buf) > 0 {
-		j_arr = append(j_arr, yu_fast.B2S(j_buf))
+		j_arr = append(j_arr, string(j_buf))
 		j_buf = make([]byte, 0, len(s))
 	}
 	return j_arr

+ 5 - 5
strings/to_windows.go

@@ -6,7 +6,7 @@ package yu_strings
 // 	j_utf8_len := uintptr(len(utf8))
 // 	j_unicode_len := j_utf8_len * 2
 // 	j_unicode := make([]byte, j_unicode_len)
-// 	return yu_fast.B2S(j_unicode[:yu_win.MultiByteToWideChar.CallInt(65001, 0, utf8, j_utf8_len, j_unicode, j_unicode_len)*2])
+// 	return string(j_unicode[:yu_win.MultiByteToWideChar.CallInt(65001, 0, utf8, j_utf8_len, j_unicode, j_unicode_len)*2])
 // }
 //
 // func Utf8ToUnicodePtr(utf8 string) uintptr {
@@ -21,21 +21,21 @@ package yu_strings
 // 	j_unicode_len := uintptr(len(unicode))
 // 	j_utf8_size := j_unicode_len * 3
 // 	j_utf8 := make([]byte, j_utf8_size)
-// 	return yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, unicode, j_unicode_len/2, j_utf8, j_utf8_size, 0, 0)])
+// 	return string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, unicode, j_unicode_len/2, j_utf8, j_utf8_size, 0, 0)])
 // }
 //
 // func GbkToUnicode(gbk string) string {
 // 	j_gbk_len := uintptr(len(gbk))
 // 	j_unicode_len := j_gbk_len * 2
 // 	j_unicode := make([]byte, j_unicode_len)
-// 	return yu_fast.B2S(j_unicode[:yu_win.MultiByteToWideChar.CallInt(936, 0, gbk, j_gbk_len, j_unicode, j_unicode_len)*2])
+// 	return string(j_unicode[:yu_win.MultiByteToWideChar.CallInt(936, 0, gbk, j_gbk_len, j_unicode, j_unicode_len)*2])
 // }
 //
 // func UnicodeToGbk(unicode string) string {
 // 	j_unicode_len := uintptr(len(unicode))
 // 	j_gbk_size := j_unicode_len * 3
 // 	j_gbk := make([]byte, j_gbk_size)
-// 	return yu_fast.B2S(j_gbk[:yu_win.WideCharToMultiByte.CallInt(936, 0, unicode, j_unicode_len/2, j_gbk, j_gbk_size, 0, 0)])
+// 	return string(j_gbk[:yu_win.WideCharToMultiByte.CallInt(936, 0, unicode, j_unicode_len/2, j_gbk, j_gbk_size, 0, 0)])
 // }
 //
 // func Utf8ToGbk(utf8 string) string {
@@ -78,5 +78,5 @@ package yu_strings
 //
 // 	j_utf8 := make([]byte, len*3+2) // 结尾 {0,0}
 //
-// 	return yu_fast.B2S(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, yu_math.MaxUint, j_utf8, len*3, 0, 0)-1]) // 结尾 {0}
+// 	return string(j_utf8[:yu_win.WideCharToMultiByte.CallInt(65001, 0, j_unicode, yu_math.MaxUint, j_utf8, len*3, 0, 0)-1]) // 结尾 {0}
 // }

+ 2 - 2
tencent/tea.go

@@ -1,7 +1,7 @@
 package yu_tencent
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
+	yu_bytes "gogs.qqck.cn/s/go-tools/bytes"
 	yu_rand "gogs.qqck.cn/s/go-tools/rand"
 )
 
@@ -167,7 +167,7 @@ func (t *Tea) De(data []byte) []byte {
 	j_iv2_bytes[5] = byte(j_iv2 >> 16)
 	j_iv2_bytes[6] = byte(j_iv2 >> 8)
 	j_iv2_bytes[7] = byte(j_iv2)
-	if yu_fast.B2S(j_iv2_bytes[1:8]) != yu_fast.B2S(data[j_data_len-15:j_data_len-8]) {
+	if !yu_bytes.Equals(j_iv2_bytes[1:8], data[j_data_len-15:j_data_len-8]) {
 		return nil
 	}
 	return j_decode[j_decode[0]&7+3 : j_data_len-7]

+ 1 - 2
tencent/tea_test.go

@@ -2,7 +2,6 @@ package yu_tencent
 
 import (
 	"fmt"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_hex "gogs.qqck.cn/s/go-tools/hex"
 	"testing"
 )
@@ -11,5 +10,5 @@ func TestTea_En(t *testing.T) {
 	j_tea := NewTea()
 	j_data := j_tea.En([]byte("d9d8443ed135a6a8749f6b92e4fb14c933e30c11483f88c2793d5c5e01ff2a78004b3b8f26d9a95230e1e87468f93b056c414c4b4760949b8f91edb90bb6d148b4700be2db0b62c6ba0d3c63e25f14da"))
 	fmt.Println(yu_hex.Upper(j_data))
-	fmt.Println(yu_fast.B2S(j_tea.De(j_data)))
+	fmt.Println(string(j_tea.De(j_data)))
 }

+ 3 - 4
url/escape.go

@@ -2,7 +2,6 @@ package yu_url
 
 import (
 	yu_const "gogs.qqck.cn/s/go-tools/const"
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 )
 
 type encoding int
@@ -63,7 +62,7 @@ func escape(s string, mode encoding) string {
 				t[i] = '+'
 			}
 		}
-		return yu_fast.B2S(t)
+		return string(t)
 	}
 
 	j := 0
@@ -82,7 +81,7 @@ func escape(s string, mode encoding) string {
 			j++
 		}
 	}
-	return yu_fast.B2S(t)
+	return string(t)
 }
 
 // Return true if the specified character should be escaped when
@@ -258,7 +257,7 @@ func unescape(s string, mode encoding) string {
 			t = append(t, s[i])
 		}
 	}
-	return yu_fast.B2S(t)
+	return string(t)
 }
 
 func ishex(c byte) bool {

+ 8 - 9
win/main.go

@@ -3,7 +3,6 @@
 package yu_win
 
 import (
-	yu_fast "gogs.qqck.cn/s/go-tools/fast"
 	yu_math "gogs.qqck.cn/s/go-tools/math"
 	_ "syscall"
 	_ "unsafe"
@@ -60,23 +59,23 @@ func (t Address) CallGbkToUtf8(args ...any) string {
 		return ""
 	}
 
-	j_unicode_len, _, _ := MultiByteToWideChar.Call(936, 0, j_str, yu_math.MaxUint, 0, 0)
+	j_unicode_len, _, _ := MultiByteToWideChar.Call(936, 0, j_str, uint(yu_math.MaxUint), 0, 0)
 	if j_unicode_len < 1 {
 		return ""
 	}
 	j_unicode_len *= 2
 	j_unicode := make([]byte, j_unicode_len+2) // 结尾 {0,0}
-	MultiByteToWideChar.Call(936, 0, j_str, yu_math.MaxUint, j_unicode, j_unicode_len)
+	MultiByteToWideChar.Call(936, 0, j_str, uint(yu_math.MaxUint), j_unicode, j_unicode_len)
 
-	j_utf8_size, _, _ := WideCharToMultiByte.Call(65001, 0, j_unicode, yu_math.MaxUint, 0, 0, 0, 0)
+	j_utf8_size, _, _ := WideCharToMultiByte.Call(65001, 0, j_unicode, uint(yu_math.MaxUint), 0, 0, 0, 0)
 	j_utf8_size -= 1
 	if j_utf8_size < 1 {
 		return ""
 	}
 	j_utf8 := make([]byte, j_utf8_size)
-	WideCharToMultiByte.Call(65001, 0, j_unicode, yu_math.MaxUint, j_utf8, j_utf8_size, 0, 0)
+	WideCharToMultiByte.Call(65001, 0, j_unicode, uint(yu_math.MaxUint), j_utf8, j_utf8_size, 0, 0)
 
-	return yu_fast.B2S(j_utf8)
+	return string(j_utf8)
 }
 
 func (t Address) CallUnicodeToUtf8(args ...any) string {
@@ -85,15 +84,15 @@ func (t Address) CallUnicodeToUtf8(args ...any) string {
 		return ""
 	}
 
-	j_utf8_size, _, _ := WideCharToMultiByte.Call(65001, 0, j_ptr, yu_math.MaxUint, 0, 0, 0, 0)
+	j_utf8_size, _, _ := WideCharToMultiByte.Call(65001, 0, j_ptr, uint(yu_math.MaxUint), 0, 0, 0, 0)
 	j_utf8_size -= 1
 	if j_utf8_size < 1 {
 		return ""
 	}
 	j_utf8 := make([]byte, j_utf8_size)
-	WideCharToMultiByte.Call(65001, 0, j_ptr, yu_math.MaxUint, j_utf8, j_utf8_size, 0, 0)
+	WideCharToMultiByte.Call(65001, 0, j_ptr, uint(yu_math.MaxUint), j_utf8, j_utf8_size, 0, 0)
 
-	return yu_fast.B2S(j_utf8)
+	return string(j_utf8)
 }
 
 type Module uintptr