Split out seeds

This commit is contained in:
Ian Gulliver
2023-12-26 08:12:24 -08:00
parent 0d95420bdf
commit 77fc700dc9
2 changed files with 4 additions and 3 deletions

41
seeds/seeds.go Normal file
View File

@@ -0,0 +1,41 @@
package seeds
import (
"github.com/securemesh/coding/heap"
)
var chatHeap = newHeapFromSeed([][]byte{
[]byte(`]\_}`),
[]byte(`[ê%=Z`),
[]byte(`#ÄQ<>`),
[]byte(`&X@+*`),
[]byte(`$~"V;`),
[]byte(`/78q9`),
[]byte("zRE54F(U-6\n"),
[]byte(`NLx:C01D2BJ)K3GP`),
[]byte(`STWH!OYAjM`),
[]byte(`?,'`),
[]byte(`bIv`),
[]byte(`mygwc.pfk`),
[]byte(`isrhlud`),
[]byte(`eotan`),
[]byte(` `),
})
func ChatHeap() *heap.Heap {
return chatHeap.Clone()
}
func newHeapFromSeed(seed [][]byte) *heap.Heap {
h := heap.NewHeap()
for i := range seed {
for _, s := range seed[i:] {
for _, b := range s {
h.IncrementSymbol(b)
}
}
}
return h
}