// See cairo_font_options_hash().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-font-options-t.html#cairo-font-options-hash
484915
func (options *FontOptions) Hash() uint32 {
	ret := uint32(C.cairo_font_options_hash(options.Ptr))
	if err := options.status(); err != nil {
		panic(err)
	}
	return ret
}
430125
func (this *AsciiRender) LoadFont(fontPath string) error {
	return this.fontMgr.loadFont(fontPath)
}
1193996
func (b *Block) Hash() cmn.HexBytes {
	if b == nil {
		return nil
	}
	b.mtx.Lock()
	defer b.mtx.Unlock()

	if b == nil || b.LastCommit == nil {
		return nil
	}
	b.fillHeader()
	return b.Header.Hash()
}
1264803
func (j *RS256JWTStrategy) Hash(ctx context.Context, in []byte) ([]byte, error) {
	// SigningMethodRS256
	hash := sha256.New()
	_, err := hash.Write(in)
	if err != nil {
		return []byte{}, errors.WithStack(err)
	}
	return hash.Sum([]byte{}), nil
}
15050
func (m *MemEngine) Hash(_ context.Context, d []byte) Hash {
	sum := sha512.Sum512(d)
	return Hash(sum[:])
}
578096
func (options *FontOptions) SetHintMetrics(hintMetrics HintMetrics) {
	C.cairo_font_options_set_hint_metrics(options.Ptr, C.cairo_hint_metrics_t(hintMetrics))
	if err := options.status(); err != nil {
		panic(err)
	}
}
1352693
func (cr *Context) FontExtents(extents *FontExtents) {
	C.cairo_font_extents(cr.Ptr, (*C.cairo_font_extents_t)(unsafe.Pointer(extents)))
	if err := cr.status(); err != nil {
		panic(err)
	}
}
1247338
func (original *FontOptions) Copy() *FontOptions {
	ret := wrapFontOptions(C.cairo_font_options_copy(original.Ptr))
	if err := original.status(); err != nil {
		panic(err)
	}
	return ret
}
1034940
func (f *Font) SetStyle(style int) {
	C.TTF_SetFontStyle(f.f, C.int(style))
}
754727
func (options *FontOptions) GetSubpixelOrder() SubpixelOrder {
	ret := SubpixelOrder(C.cairo_font_options_get_subpixel_order(options.Ptr))
	if err := options.status(); err != nil {
		panic(err)
	}
	return ret
}
801355
func (scaledFont *ScaledFont) GlyphExtents(glyphs []Glyph, extents *TextExtents) {
	C.cairo_scaled_font_glyph_extents(scaledFont.Ptr, (*C.cairo_glyph_t)(sliceBytes(unsafe.Pointer(&glyphs))), C.int(len(glyphs)), (*C.cairo_text_extents_t)(unsafe.Pointer(extents)))
	if err := scaledFont.status(); err != nil {
		panic(err)
	}
}
516883
func (c Cmd) hash() cmdHash {
	output := c.Name
	for _, arg := range c.Args {
		output += fmt.Sprintf("%v", arg)
	}
	return cmdHash(output)
}
1338674
func (o *Options) HashOptions() string {
	hasher := sha1.New()

	hasher.Write([]byte(o.CTags))
	hasher.Write([]byte(fmt.Sprintf("%t", o.CTagsMustSucceed)))
	hasher.Write([]byte(fmt.Sprintf("%d", o.SizeMax)))
	hasher.Write([]byte(fmt.Sprintf("%q", o.LargeFiles)))

	return fmt.Sprintf("%x", hasher.Sum(nil))
}
1036812
func (fontFace *FontFace) status() error {
	ret := Status(C.cairo_font_face_status(fontFace.Ptr)).toError()
	return ret
}
280350
func (options *Options) HashStr(name string) string {
	return Str(options.hash[name])
}
563856
func (h hashPrefix) HasPrefix(other hashPrefix) bool {
	return strings.HasPrefix(string(h), string(other))
}
453660
func StrToHash(hash string) (crypto.Hash, error) {
	switch hash {
	case "SHA1", "SHA-1":
		return crypto.SHA1, nil
	case "SHA224", "SHA-224":
		return crypto.SHA224, nil
	case "SHA256", "SHA-256":
		return crypto.SHA256, nil
	case "SHA384", "SHA-384":
		return crypto.SHA384, nil
	case "SHA512", "SHA-512":
		return crypto.SHA512, nil
	case "SHA512_224", "SHA512/224", "SHA-512_224", "SHA-512/224":
		return crypto.SHA512_224, nil
	case "SHA512_256", "SHA512/256", "SHA-512_256", "SHA-512/256":
		return crypto.SHA512_256, nil
	}
	return 0, errors.Errorf("no such hash %s", hash)
}