/*
*计算挖矿difficulty
*/
func CalculateDifficulty(strTargetHash string) string {
strGeniusBlockHash := "00000000ffff0000000000000000000000000000000000000000000000000000" // 创世块编号
var biGeniusHash big.Int
var biTargetHash big.Int
biGeniusHash.SetString(strGeniusBlockHash, 16)
biTargetHash.SetString(strTargetHash, 16)
difficulty := big.NewInt(0)
difficulty.Div(&biGeniusHash, &biTargetHash)
//fmt.Printf("%T \n" , difficulty)
return fmt.Sprintf("%s", difficulty)
}
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Game Engine Architecture, Second Edition
Jason Gregory / A K Peters/CRC Press / 2014-8-15 / USD 69.95
A 2010 CHOICE outstanding academic title, this updated book covers the theory and practice of game engine software development. It explains practical concepts and techniques used by real game studios,......一起来看看 《Game Engine Architecture, Second Edition》 这本书的介绍吧!