package vals

import (
	
	

	
)

// Hasher wraps the Hash method.
type Hasher interface {
	// Hash computes the hash code of the receiver.
	Hash() uint32
}

// Hash returns the 32-bit hash of a value. It is implemented for the builtin
// types bool and string, the File, List, Map types, StructMap types, and types
// satisfying the Hasher interface. For other values, it returns 0 (which is OK
// in terms of correctness).
func ( interface{}) uint32 {
	switch v := .(type) {
	case bool:
		if  {
			return 1
		}
		return 0
	case float64:
		return hash.UInt64(math.Float64bits())
	case string:
		return hash.String()
	case Hasher:
		return .Hash()
	case File:
		return hash.UIntPtr(.Fd())
	case List:
		 := hash.DJBInit
		for  := .Iterator(); .HasElem(); .Next() {
			 = hash.DJBCombine(, (.Elem()))
		}
		return 
	case Map:
		 := hash.DJBInit
		for  := .Iterator(); .HasElem(); .Next() {
			,  := .Elem()
			 = hash.DJBCombine(, ())
			 = hash.DJBCombine(, ())
		}
		return 
	case StructMap:
		 := hash.DJBInit
		 := iterateStructMap(reflect.TypeOf())
		 := reflect.ValueOf()
		for .Next() {
			,  := .Get()
			 = hash.DJBCombine(, ())
		}
		return 
	}
	return 0
}