// Divide bs into slices according to size, and each slice length is size
Divide bs into slices according to size, and each slice length is size
// Divide bs into slices according to size and each slice length is size
func SplitBytes(bs []byte, size int) ([][]byte, error) {
	if len(bs)%size != 0 {
		return nil, errors.New(fmt.Sprintf("input length illegal: (%d)%%(%d)!=0", len(bs), size))
	}
	r := make([][]byte, 0, len(bs)/size)
	for p := 0; p < len(bs); p += size {
		o := CopyBytes(bs[p : p+size])
		r = append(r, o)
	}
	return r, nil
}
func SplitBytes ( bs [ ] byte , size int ) ( [ ] [ ] byte , error ) { if len ( bs ) % size != 0 { return nil , errors . New ( fmt . Sprintf ( " " , len ( bs ) , size ) ) } r := make ( [ ] [ ] byte , 0 , len ( bs ) / size ) for p := 0 ; p < len ( bs ) ; p += size { o := CopyBytes ( bs [ p : p + size ] ) r = append ( r , o ) } return r , nil }
Divide bs into slices according to size, and each slice length is size
Divide bs into slices according to size and each slice length is size