util

package
v1.0.0-...-545503d Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToByte

func BoolToByte(b bool, v byte) byte

BoolToByte は、真偽値を特定のバイトに変換します。

func BytesToInts

func BytesToInts(b []byte) []int

BytesToInts は、バイト列を整数の配列に変換します。

func DecodeShiftJIS

func DecodeShiftJIS(s []uint8) string

DecodeShiftJIS は、シフトJISのバイト列をUTF-8の文字列に変換します。

func Escape

func Escape(stream []uint8) string

Escape は、バイト列をJSON風の文字列で表現します(デバッグ表示用)。

func GCD

func GCD(a, b int) int

GCD は、2つの整数の最大公約数を求めます。

func Hex

func Hex(stream []uint8) string

Hex は、バイト列を16進数の文字列で表現します(デバッグ表示用)。

func Indent

func Indent(text string, indent string) string

Indent は、複数行のテキストをインデントします。

func ReadVariableInt

func ReadVariableInt(allow3bytes bool, rdr io.Reader, rest *int) (int, error)

ReadVariableInt は、可変長形式で記録されている整数値を読み取ります。

func SplitOptionalData

func SplitOptionalData(s string) map[string]string

SplitOptionalData は、ContentsInfoChunk に含まれるオプション情報をパースし、マップに整理して返します。

func ZeroPadSliceToString

func ZeroPadSliceToString(s []byte) string

ZeroPadSliceToString は、末尾がヌル文字で埋められた文字列を通常の文字列に変換します。

Types

This section is empty.

Jump to

Keyboard shortcuts

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