bytesconv

package
v0.0.0-...-524df1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2019 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Hex2intTable = "" /* 1002-byte string literal not displayed */
View Source
const QuotedArgShouldEscapeTable = "" /* 1024-byte string literal not displayed */
View Source
const QuotedPathShouldEscapeTable = "" /* 1024-byte string literal not displayed */
View Source
const ToLowerTable = "" /* 729-byte string literal not displayed */
View Source
const ToUpperTable = "" /* 729-byte string literal not displayed */

Variables

This section is empty.

Functions

func AppendHTMLEscape

func AppendHTMLEscape(dst []byte, s string) []byte

AppendHTMLEscape appends html-escaped s to dst and returns the extended dst.

func AppendHTMLEscapeBytes

func AppendHTMLEscapeBytes(dst, s []byte) []byte

AppendHTMLEscapeBytes appends html-escaped s to dst and returns the extended dst.

func AppendHTTPDate

func AppendHTTPDate(dst []byte, date time.Time) []byte

AppendHTTPDate appends HTTP-compliant (RFC1123) representation of date to dst and returns the extended dst.

func AppendIPv4

func AppendIPv4(dst []byte, ip net.IP) []byte

AppendIPv4 appends string representation of the given ip v4 to dst and returns the extended dst.

func AppendQuotedArg

func AppendQuotedArg(dst, src []byte) []byte

AppendQuotedArg appends url-encoded src to dst and returns appended dst.

func AppendQuotedPath

func AppendQuotedPath(dst, src []byte) []byte

func AppendUint

func AppendUint(dst []byte, n int) []byte

AppendUint appends n to dst and returns the extended dst.

func AppendUnquotedArg

func AppendUnquotedArg(dst, src []byte) []byte

AppendUnquotedArg appends url-decoded src to dst and returns appended dst.

dst may point to src. In this case src will be overwritten.

func DecodeArgAppend

func DecodeArgAppend(dst, src []byte) []byte

func DecodeArgAppendNoPlus

func DecodeArgAppendNoPlus(dst, src []byte) []byte

DecodeArgAppendNoPlus is almost identical to DecodeArgAppend, but it doesn't substitute '+' with ' '.

The function is copy-pasted from DecodeArgAppend due to the performance reasons only.

func LowercaseBytes

func LowercaseBytes(b []byte)

func ParseHTTPDate

func ParseHTTPDate(date []byte) (time.Time, error)

ParseHTTPDate parses HTTP-compliant (RFC1123) date.

func ParseIPv4

func ParseIPv4(dst net.IP, ipStr []byte) (net.IP, error)

ParseIPv4 parses ip address from ipStr into dst and returns the extended dst.

func ParseUfloat

func ParseUfloat(buf []byte) (float64, error)

ParseUfloat parses unsigned float from buf.

func ParseUint

func ParseUint(buf []byte) (int, error)

ParseUint parses uint from buf.

func ParseUintBuf

func ParseUintBuf(b []byte) (int, int, error)

func ReadHexInt

func ReadHexInt(r *bufio.Reader) (int, error)

func ToString

func ToString(b []byte) string

b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .

Note it may break if string and/or slice header will change in the future go versions.

func Tobytes

func Tobytes(s string) (b []byte)

s2b converts string to a byte slice without memory allocation.

Note it may break if string and/or slice header will change in the future go versions.

func WriteHexInt

func WriteHexInt(w *bufio.Writer, n int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL