arrays/arrays.go
func Dump(arr []byte) string {
	var buf bytes.Buffer

	buf.WriteString("(")
	buf.WriteString(fmt.Sprintf("%v", len(arr)))
	buf.WriteString(" bytes)[")

	for idx, b := range arr {
		buf.WriteString(fmt.Sprintf("%v", b))
		if idx != len(arr)-1 {
			buf.WriteString(", ")
		}
	}

	buf.WriteString("], Hex: [")

	for idx, b := range arr {
		buf.WriteString(fmt.Sprintf("%X", b))
		if idx != len(arr)-1 {
			buf.WriteString(" ")
		}
	}

	buf.WriteString("], Base64Url:")
	buf.WriteString(base64url.Encode(arr))

	return buf.String()
}
func Dump(arr []byte) string {
	var buf bytes.Buffer

	buf.WriteString("(")
	buf.WriteString(fmt.Sprintf("%v", len(arr)))
	buf.WriteString(" bytes)[")

	for idx, b := range arr {
		buf.WriteString(fmt.Sprintf("%v", b))
		if idx != len(arr)-1 {
			buf.WriteString(", ")
		}
	}

	buf.WriteString("], Hex: [")

	for idx, b := range arr {
		buf.WriteString(fmt.Sprintf("%X", b))
		if idx != len(arr)-1 {
			buf.WriteString(" ")
		}
	}

	buf.WriteString("], Base64Url:")
	buf.WriteString(base64url.Encode(arr))

	return buf.String()
}
func Dump ( arr [ ] byte ) string { var buf bytes . Buffer buf . WriteString ( " " ) buf . WriteString ( fmt . Sprintf ( " " , len ( arr ) ) ) buf . WriteString ( " " ) for idx , b := range arr { buf . WriteString ( fmt . Sprintf ( " " , b ) ) if idx != len ( arr ) - 1 { buf . WriteString ( " " ) } } buf . WriteString ( " " ) for idx , b := range arr { buf . WriteString ( fmt . Sprintf ( " " , b ) ) if idx != len ( arr ) - 1 { buf . WriteString ( " " ) } } buf . WriteString ( " " ) buf . WriteString ( base64url . Encode ( arr ) ) return buf . String ( ) }
// Dump produces printable debug representation of byte array as string
Dump produces printable debug representation of byte array as string