GO語言"encoding/hex"包中"Dump"函數的用法及代碼示例。
用法:
func Dump(data []byte) string
Dump 返回一個字符串,其中包含給定數據的十六進製轉儲。十六進製轉儲的格式與命令行上的 `hexdump -C` 的輸出相匹配。
例子:
package main
import (
"encoding/hex"
"fmt"
)
func main() {
content := []byte("Go is an open source programming language.")
fmt.Printf("%s", hex.Dump(content))
}
輸出:
00000000 47 6f 20 69 73 20 61 6e 20 6f 70 65 6e 20 73 6f |Go is an open so| 00000010 75 72 63 65 20 70 72 6f 67 72 61 6d 6d 69 6e 67 |urce programming| 00000020 20 6c 61 6e 67 75 61 67 65 2e | language.|
相關用法
- GO DumpResponse用法及代碼示例
- GO DumpRequest用法及代碼示例
- GO DumpRequestOut用法及代碼示例
- GO Dumper用法及代碼示例
- GO Duration.Hours用法及代碼示例
- GO Duration.Round用法及代碼示例
- GO Duration用法及代碼示例
- GO Duration.Truncate用法及代碼示例
- GO Duration.String用法及代碼示例
- GO Duration.Minutes用法及代碼示例
- GO Duration.Milliseconds用法及代碼示例
- GO Duration.Seconds用法及代碼示例
- GO Duration.Microseconds用法及代碼示例
- GO Duration.Nanoseconds用法及代碼示例
- GO DecodeLastRuneInString用法及代碼示例
- GO DB.QueryRowContext用法及代碼示例
- GO Date用法及代碼示例
- GO DB.ExecContext用法及代碼示例
- GO Dial用法及代碼示例
- GO DB.BeginTx用法及代碼示例
注:本文由純淨天空篩選整理自golang.google.cn大神的英文原創作品 Dump。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。