// The binary byte array represented by bs is restored to a byte. Each byte of bs is 0x0 or
// 0x1, and supports up to 8 bits of binary
The binary byte array represented by bs is restored to a byte. Each byte of bs is 0x0 or
0x1, and supports up to 8 bits of binary
// The binary byte array represented by bs is restored to a byte . Each byte of bs is 0x0 or // 0x1 and supports up to 8 bits of binary
func ToByte(bs []byte) (byte, error) {
	if len(bs) > 8 {
		return 0, common.ErrUnsupported
	}
	var b byte
	var i uint
	l := uint(len(bs))
	for i = 0; i < l; i++ {
		if bs[i] == 0x1 {
			b |= 0x1 << (l - i - 1)
		}
	}
	return b, nil
}
func ToByte ( bs [ ] byte ) ( byte , error ) { if len ( bs ) > 8 { return 0 , common . ErrUnsupported } var b byte var i uint l := uint ( len ( bs ) ) for i = 0 ; i < l ; i ++ { if bs [ i ] == 0x1 { b |= 0x1 << ( l - i - 1 ) } } return b , nil }
The binary byte array represented by bs is restored to a byte.
The binary byte array represented by bs is restored to a byte .