示例#1
0
文件: signature.go 项目: kitak/magick
// Signature computes a message digest from an image pixel stream with an
// implementation of the NIST SHA-256 Message Digest algorithm. This
// signature uniquely identifies the image and is convenient for determining
// if an image has been modified or whether two images are identical.
func (im *Image) Signature() uint {
	return uint(C.SignatureImage(im.image))
}
示例#2
0
// Signature computes a message digest from an image pixel stream with an
// implementation of the NIST SHA-256 Message Digest algorithm. This
// signature uniquely identifies the image and is convenient for determining
// if an image has been modified or whether two images are identical.
func (im *Image) Signature() string {
	if !im.HasProperty("signature") {
		C.SignatureImage(im.image)
	}
	return im.Property("signature")
}