go implementation of CodeDweller/mishmash.hpp/cpp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mishmash_test.go 521B

3 yıl önce
1234567891011121314151617181920212223
  1. package mishmash
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestMishmashString(t *testing.T) {
  7. want := "9d923077"
  8. if got := fmt.Sprintf("%08x", Mishmash([]byte("google.com"))); want != got {
  9. t.Error("Parse() = got", got, "want", want)
  10. } else {
  11. fmt.Println("TestMishmashString passed")
  12. }
  13. }
  14. func TestMishmashUint32(t *testing.T) {
  15. var want uint32 = 2643603575
  16. if got := Mishmash([]byte("google.com")); want != got {
  17. t.Error("Parse() = got", got, "want", want)
  18. } else {
  19. fmt.Println("TestMishmashUint32 passed")
  20. }
  21. }