算算猪八戒的utf8的whirlpool的亿次值
go
版
package mainimport (
"encoding/hex"
"fmt"
"github.com/jzelinskie/whirlpool"
)
func main() {
data := "猪八戒"
w := whirlpool.New()
for i := 0; i < 100000000; i++ {
w.Write([]byte(data))
data = hex.EncodeToString(w.Sum(nil))
w.Reset()
}
fmt.Println(data)
}
613.285 seconds
python
版
import whirlpoolstr = "猪八戒"
for _ in range(100000000):
str = whirlpool.new(str.encode(encoding="utf-8")).hexdigest()
print(f"whirlpool: {str}")
294.657 seconds
python
较快点。。。
以上是 算算猪八戒的utf8的whirlpool的亿次值 的全部内容, 来源链接: utcz.com/z/518708.html