-3
어떻게이 방법을 Ruby 1.9.3에서 Golang 1.7로 복제 할 수 있습니까?Ruby 1.9.3 Golang에서 Digest :: SHA1.hexdigest와 일치
require 'digest/sha2'
text = Digest::SHA1.hexdigest("Hello world")
어떻게이 방법을 Ruby 1.9.3에서 Golang 1.7로 복제 할 수 있습니까?Ruby 1.9.3 Golang에서 Digest :: SHA1.hexdigest와 일치
require 'digest/sha2'
text = Digest::SHA1.hexdigest("Hello world")
사용 crypto/sha1
package main
import (
"crypto/sha1"
"fmt"
)
func main() {
s := sha1.New()
s.Write([]byte("Hello world"))
fmt.Printf("%x", s.Sum(nil))
}
아마도 https://gobyexample.com/sha1-hashes – biosckon