Esempio n. 1
0
func doargs() {
	flag.Parse()
	var i int
	var crn string
	for i = 0; i < flag.NArg(); i++ {
		crn = s.ToUpper(flag.Arg(i))
		fmt.Printf("%6d  %s\n", sesshash.SessOrd(crn, 19997), crn)
	}
}
Esempio n. 2
0
func doargs() {
	flag.Parse()
	var size int = 19997
	//    var nsize int
	var i int
	var crn string
	for i = 0; i < flag.NArg(); i++ {
		crn = s.ToUpper(flag.Arg(i))
		if nsize, err := strconv.Atoi(crn); err == nil {
			size = nsize
		} else {
			fmt.Printf("%6d,%6d,%s\n", sesshash.SessOrd(crn, size), size, crn)
		}
	}
}
Esempio n. 3
0
func doloop() {
	ekey := make([]int, 19997, 19997)
	var i int
	var crn string
	var hash int
	//	t := time.Now()
	for i = 0; i < 100000; i++ {
		crn = fmt.Sprintf("DXA%05d", i)
		hash = sesshash.SessOrd(crn, 19997)
		ekey[hash] += 1
		if ekey[hash] > 9 {
			fmt.Println(crn, ekey[hash], hash)
		}
	}
	//	fmt.Println("Ord,Num")
	//	for i = 0; i < len(ekey); i++ {
	//		fmt.Printf("%d,%d\n",i,ekey[i])
	//	}
}