This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pearson | |
/* Get an initial hash value by passing in the length of the array. */ | |
func Init(length int) (hash byte) { return byte(length % 256) } | |
/* Given the hash of a string S0..SN and the character SN+1, | |
get the hash of the string S0..SN+1. | |
*/ | |
func FeedByte(oldhash byte, next byte) (newhash byte) { | |
/* The following table is the result of the pseudorandom order at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package trie | |
import ( | |
"container/vector" | |
"sort" | |
) | |
// A 'set' structure, that can hold []byte objects. | |
// For any one []byte instance, it is either in the set or not. | |
type Trie struct { |
NewerOlder