mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* try decode * vendor crypto deps * commited missing vendor deps * Theme: Refactoring theme colors variables (#23513) * Theme: Typography updates * Updated * Updated snapshot * Renamed colors to palette * Introduce colors namespace * Massive theme color move * Removing color selection logic with more abstract concepts * Updates * Minor sidemenu change * Fix example jaeger agent port in docs (#23514) * @grafana/ui: Replace various icons using Icon component (#23442) * Replace icons in dashboard and settings * Replace icons in alerting * Update batch of icons * Implement icons accross various files * Style updates * Search: Fix recent and starred icons * Update styling and details * Replace new icon created by unicons * Fix e2e test, styling * Minor styling updates Co-authored-by: Clarity-89 <homes89@ukr.net> * trying with p512 key * trying with p512 key * lint * update with real signatures * fixes spacing in test files * remove convey from test * use errutil to wrap errors * removes print statement * splitt tests into two run statements * unexport plugin manifest struct Co-authored-by: bergquist <carl.bergquist@gmail.com> Co-authored-by: Torkel Ödegaard <torkel@grafana.com> Co-authored-by: Vitaly Zhuravlev <v-zhuravlev@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Clarity-89 <homes89@ukr.net>
60 lines
1.1 KiB
Go
60 lines
1.1 KiB
Go
// Copyright 2011 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package openpgp
|
|
|
|
import "hash"
|
|
|
|
// NewCanonicalTextHash reformats text written to it into the canonical
|
|
// form and then applies the hash h. See RFC 4880, section 5.2.1.
|
|
func NewCanonicalTextHash(h hash.Hash) hash.Hash {
|
|
return &canonicalTextHash{h, 0}
|
|
}
|
|
|
|
type canonicalTextHash struct {
|
|
h hash.Hash
|
|
s int
|
|
}
|
|
|
|
var newline = []byte{'\r', '\n'}
|
|
|
|
func (cth *canonicalTextHash) Write(buf []byte) (int, error) {
|
|
start := 0
|
|
|
|
for i, c := range buf {
|
|
switch cth.s {
|
|
case 0:
|
|
if c == '\r' {
|
|
cth.s = 1
|
|
} else if c == '\n' {
|
|
cth.h.Write(buf[start:i])
|
|
cth.h.Write(newline)
|
|
start = i + 1
|
|
}
|
|
case 1:
|
|
cth.s = 0
|
|
}
|
|
}
|
|
|
|
cth.h.Write(buf[start:])
|
|
return len(buf), nil
|
|
}
|
|
|
|
func (cth *canonicalTextHash) Sum(in []byte) []byte {
|
|
return cth.h.Sum(in)
|
|
}
|
|
|
|
func (cth *canonicalTextHash) Reset() {
|
|
cth.h.Reset()
|
|
cth.s = 0
|
|
}
|
|
|
|
func (cth *canonicalTextHash) Size() int {
|
|
return cth.h.Size()
|
|
}
|
|
|
|
func (cth *canonicalTextHash) BlockSize() int {
|
|
return cth.h.BlockSize()
|
|
}
|