func (t *Transaction) SetData(s string) {

	t.determineCarrierCount()

	bin := stringToBin(s)
	binLength := len(bin)

	frameData := []int{}

	frameSum := 0

	for i, binaryBit := range bin {
		carrierIndex := i % t.carrierCount
		bit := int(binaryBit) - 48
		frameData = append(frameData, bit)
		frameSum += bit

		if carrierIndex == (t.carrierCount-1) || i == (binLength-1) {
			byteLength := len(frameData) / 8
			byteOffset := len(t.Frames) * byteLength

			fmt.Println(frameData, s[byteOffset:byteLength+byteOffset], frameSum)

			f := frame.NewFrame(frameData...)
			t.AddFrame(f)
			frameData = []int{}
			frameSum = 0
		}
	}

}
// SetData sets the data for the transaction
SetData sets the data for the transaction
// SetData sets the data for the transaction
func (t *Transaction) SetData(s string) {
	t.determineCarrierCount()
	bin := stringToBin(s)
	binLength := len(bin)
	frameData := []int{}
	frameSum := 0
	for i, binaryBit := range bin {
		carrierIndex := i % t.carrierCount
		bit := int(binaryBit) - 48
		frameData = append(frameData, bit)
		frameSum += bit
		if carrierIndex == (t.carrierCount-1) || i == (binLength-1) {
			byteLength := len(frameData) / 8
			byteOffset := len(t.Frames) * byteLength
			fmt.Println(frameData, s[byteOffset:byteLength+byteOffset], frameSum)
			f := frame.NewFrame(frameData...)
			t.AddFrame(f)
			frameData = []int{}
			frameSum = 0
		}
	}
}
func ( t * Transaction ) SetData ( s string ) { t . determineCarrierCount ( ) bin := stringToBin ( s ) binLength := len ( bin ) frameData := [ ] int { } frameSum := 0 for i , binaryBit := range bin { carrierIndex := i % t . carrierCount bit := int ( binaryBit ) - 48 frameData = append ( frameData , bit ) frameSum += bit if carrierIndex == ( t . carrierCount - 1 ) || i == ( binLength - 1 ) { byteLength := len ( frameData ) / 8 byteOffset := len ( t . Frames ) * byteLength fmt . Println ( frameData , s [ byteOffset : byteLength + byteOffset ] , frameSum ) f := frame . NewFrame ( frameData ... ) t . AddFrame ( f ) frameData = [ ] int { } frameSum = 0 } } }
SetData sets the data for the transaction
SetData sets the data for the transaction