Discover Packages
github.com/koykov/fastconv
package
module
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Apr 6, 2023
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 8 modules, 14 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
Fast conversion algorithms
Byte-string-rune conversion
At the moment supports the following conversion:
[]byte -> string using BytesToString()/B2S()
string -> []byte using StringToBytes()/S2B()
[]byte -> []rune using AppendBytesToRunes()/AppendB2R()
[]rune -> []byte using AppendRunesToBytes()/AppendR2B()
string -> []rune using AppendStringToRunes()/AppendS2R()
[]rune -> string using AppendRunesToString()/AppendR2S()
All functions perform fast conversions using unsafe cast and/or buffer approach.
Expand ▾
Collapse ▴
Documentation
¶
func AppendB2R(dst []rune, b []byte) []rune
func AppendBytesToRunes(dst []rune, p []byte) []rune
func AppendR2B(dst []byte, r []rune) []byte
func AppendR2S(buf []byte, r []rune) ([]byte, string)
func AppendRunesToBytes(dst []byte, r []rune) []byte
func AppendRunesToString(buf []byte, r []rune) ([]byte, string)
func AppendS2R(dst []rune, s string) []rune
func AppendStringToRunes(dst []rune, s string) []rune
func B2S(b []byte) string
func BytesToString(b []byte) string
func S2B(s string) []byte
func StringToBytes(s string) []byte
AppendB2R is a shorthand alias of AppendBytesToRunes().
AppendBytesToRunes converts byte array to runes array.
AppendR2B is a shorthand alias of AppendRunesToBytes().
AppendR2S is a shorthand alias of AppendRunesToString().
AppendRunesToBytes converts runes array to bytes array.
AppendRunesToString converts runes array to string using byte buffer.
AppendS2R is a shorthand alias of AppendStringToRunes().
AppendStringToRunes converts string to runes array.
B2S is a shorthand alias of BytesToString().
BytesToString makes fast conversion of bytes array to string.
S2B is a shorthand alias of StringToBytes().
StringToBytes makes fast conversion of string to bytes sequence.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.