encrypt_test.go 619 B

1234567891011121314151617181920212223242526272829
  1. package util
  2. import (
  3. "log"
  4. "testing"
  5. )
  6. /*
  7. func TestDecodeBasic(t *testing.T) {
  8. tests := []struct {
  9. name string
  10. header http.Header
  11. expUsername string
  12. expPassword string
  13. }{
  14. */
  15. func TestMd5Sum(t *testing.T) {
  16. test := []byte("hello")
  17. m5 := Md5Sum(test)
  18. // [93, 65, 64, 42, 188, 75, 42, 118, 185, 113, 157, 145, 16, 23, 197, 146]
  19. log.Println(m5)
  20. }
  21. func TestEvpBytesToKey(t *testing.T) {
  22. key := EvpBytesToKey("hello", 32)
  23. // [93, 65, 64, 42, 188, 75, 42, 118, 185, 113, 157, 145, 16, 23, 197, 146, 40, 180, 110, 211, 193, 17, 232, 81, 2, 144, 155, 28, 251, 80, 234, 15]
  24. log.Println(key)
  25. }