(buf []byte)
| 107 | func (r Ref) HasPrefix(s string) bool { return r.digest.hasPrefix(s) } |
| 108 | |
| 109 | func (r Ref) appendString(buf []byte) []byte { |
| 110 | dname := r.digest.digestName() |
| 111 | bs := r.digest.bytes() |
| 112 | buf = append(buf, dname...) |
| 113 | buf = append(buf, '-') |
| 114 | for _, b := range bs { |
| 115 | buf = append(buf, hexDigit[b>>4], hexDigit[b&0xf]) |
| 116 | } |
| 117 | if o, ok := r.digest.(otherDigest); ok && o.odd { |
| 118 | buf = buf[:len(buf)-1] |
| 119 | } |
| 120 | return buf |
| 121 | } |
| 122 | |
| 123 | // HashName returns the lowercase hash function name of the reference. |
| 124 | // It panics if r is zero. |
no test coverage detected