20 lines
323 B
Go
20 lines
323 B
Go
package tools
|
|
|
|
import "testing"
|
|
|
|
func TestMD5(t *testing.T) {
|
|
str, salt := "123", "456"
|
|
println(MD5(str))
|
|
println(MD5(str + salt))
|
|
println(MD5WithSalt(str, salt))
|
|
}
|
|
|
|
func TestRandSaltN(t *testing.T) {
|
|
for i := 1; i < 10; i++ {
|
|
println(RandSalt())
|
|
for j := 0; j < 10; j++ {
|
|
println(RandSaltN(uint8(i)))
|
|
}
|
|
}
|
|
}
|