算算猪八戒的utf8的whirlpool的亿次值

编程

go

package main

import (

"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 whirlpool

str = "猪八戒"

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

回到顶部