func _TestUlidBitShifting(t *testing.T) {
	buf := make([]uint8, 2)
	rand.Reader.Read(buf)
	now := nowUnixUtc()
	nowB := uint64ToBytes(now)

	log.Infof("%v", buf)
	log.Infof("%v %d", nowB, now)
	nowB[6] = buf[0]
	nowB[7] = buf[1]
	log.Infof("I want this: %v %d", nowB, bytesToUint64(nowB))

	b6 := uint8(now >> 8)
	b7 := uint8(now)
	log.Infof("Last two bytes: %d %d", b6, b7)

	and := uint64(0) | uint64(0)<<8 | uint64(255)<<16 | uint64(255)<<24 |
		uint64(255)<<32 | uint64(255)<<40 | uint64(255)<<48 | uint64(255)<<56

	cleanEnd := now & and
	log.Infof("clean end: %v %d", uint64ToBytes(cleanEnd), cleanEnd)

	or := uint64(buf[1]) | uint64(buf[0])<<8 | uint64(0)<<16 | uint64(0)<<24 |
		uint64(0)<<32 | uint64(0)<<40 | uint64(0)<<48 | uint64(0)<<56

	whatIWant := cleanEnd | or
	log.Infof("what I want: %v %d", uint64ToBytes(whatIWant), whatIWant)
}
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////
//////////////////////////////////////////
// TODO -> figure out what to do here
// it seems the latency is dominated by reading from
// random anyways ... as it should
// therefore there's no real point in micro-optimizing too much
> figure out what to do here
it seems the latency is dominated by reading from
random anyways ... as it should
therefore there's no real point in micro-optimizing too much
///////////////////////////////////////////////////////// ///////////////////////////////////////////////// ////////////////////////////////////////// // TODO - > figure out what to do here // it seems the latency is dominated by reading from // random anyways ... as it should // therefore there ' s no real point in micro - optimizing too much
func _TestUlidBitShifting(t *testing.T) {
	buf := make([]uint8, 2)
	rand.Reader.Read(buf)
	now := nowUnixUtc()
	nowB := uint64ToBytes(now)
	log.Infof("%v", buf)
	log.Infof("%v %d", nowB, now)
	nowB[6] = buf[0]
	nowB[7] = buf[1]
	log.Infof("I want this: %v %d", nowB, bytesToUint64(nowB))
	b6 := uint8(now >> 8)
	b7 := uint8(now)
	log.Infof("Last two bytes: %d %d", b6, b7)
	and := uint64(0) | uint64(0)<<8 | uint64(255)<<16 | uint64(255)<<24 |
		uint64(255)<<32 | uint64(255)<<40 | uint64(255)<<48 | uint64(255)<<56
	cleanEnd := now & and
	log.Infof("clean end: %v %d", uint64ToBytes(cleanEnd), cleanEnd)
	or := uint64(buf[1]) | uint64(buf[0])<<8 | uint64(0)<<16 | uint64(0)<<24 |
		uint64(0)<<32 | uint64(0)<<40 | uint64(0)<<48 | uint64(0)<<56
	whatIWant := cleanEnd | or
	log.Infof("what I want: %v %d", uint64ToBytes(whatIWant), whatIWant)
}
func _TestUlidBitShifting ( t * testing . T ) { buf := make ( [ ] uint8 , 2 ) rand . Reader . Read ( buf ) now := nowUnixUtc ( ) nowB := uint64ToBytes ( now ) log . Infof ( " " , buf ) log . Infof ( " " , nowB , now ) nowB [ 6 ] = buf [ 0 ] nowB [ 7 ] = buf [ 1 ] log . Infof ( " " , nowB , bytesToUint64 ( nowB ) ) b6 := uint8 ( now >> 8 ) b7 := uint8 ( now ) log . Infof ( " " , b6 , b7 ) and := uint64 ( 0 ) | uint64 ( 0 ) << 8 | uint64 ( 255 ) << 16 | uint64 ( 255 ) << 24 | uint64 ( 255 ) << 32 | uint64 ( 255 ) << 40 | uint64 ( 255 ) << 48 | uint64 ( 255 ) << 56 cleanEnd := now & and log . Infof ( " " , uint64ToBytes ( cleanEnd ) , cleanEnd ) or := uint64 ( buf [ 1 ] ) | uint64 ( buf [ 0 ] ) << 8 | uint64 ( 0 ) << 16 | uint64 ( 0 ) << 24 | uint64 ( 0 ) << 32 | uint64 ( 0 ) << 40 | uint64 ( 0 ) << 48 | uint64 ( 0 ) << 56 whatIWant := cleanEnd | or log . Infof ( " " , uint64ToBytes ( whatIWant ) , whatIWant ) }
> figure out what to do here
it seems the latency is dominated by reading from
random anyways ... as it should
therefore there's no real point in micro-optimizing too much
> figure out what to do here it seems the latency is dominated by reading from random anyways ... as it should therefore there ' s no real point in micro - optimizing too much