// Itob writes an unsigned integer to the start of a given byte buffer.
Itob writes an unsigned integer to the start of a given byte buffer.
// Itob writes an unsigned integer to the start of a given byte buffer .
func Itob(number uint64, buffer []byte) error {
	numberLen := ItoLen(number)
	bufferLen := len(buffer)
	if numberLen > bufferLen {
		return fmt.Errorf("Number too large for buffer")
	}
	for i := numberLen - 1; i >= 0; i-- {
		buffer[i] = '0' + byte(number%10)
		number /= 10
	}
	return nil
}
func Itob ( number uint64 , buffer [ ] byte ) error { numberLen := ItoLen ( number ) bufferLen := len ( buffer ) if numberLen > bufferLen { return fmt . Errorf ( " " ) } for i := numberLen - 1 ; i >= 0 ; i -- { buffer [ i ] = '0' + byte ( number % 10 ) number /= 10 } return nil }
Itob writes an unsigned integer to the start of a given byte buffer.
Itob writes an unsigned integer to the start of a given byte buffer .